{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 歌曲推荐系统\n",
    "一、数据：Million Song Dataset(MSD)\n",
    " https://labrosa.ee.columbia.edu/millionsong/\n",
    "作业使用的数据集是公开音乐数据集 Million Song Dataset(MSD) ， 它 包 含 来 自 SecondHandSongs dataset 、 musiXmatch dataset、Last.fm dataset、Taste Profile subset、 thisismyjam-to-MSD mapping、tagtraum genre annotations 和 Top MAGD dataset 七个知名音乐社区的数据。\n",
    "原始数据集包括：\n",
    "1.\ttrain_triplets.txt：三元组数据（用户、歌曲、播放次数）\n",
    "2.\ttrack_metadata.db：每个歌曲的元数据\n",
    "由于原始数据太大，作业用的数据集只是其中的子集（播放次数最多的10万个用户、播放次数最多的3万首歌曲。\n",
    "数据预处理过程请见DataProcessing.ipynb文件，最后得到的数据文件为：triplet_dataset_sub_song_merged.csv（1千万条记录）\n",
    "\n",
    "二、作业要求：将triplet_dataset_sub_song_merged.csv中的数据用train_test_split分成60%数据做训练，剩下40%数据做测试。\n",
    "1.\t实现基于用户的协同过滤； （20分）\n",
    "2.\t实现基于物品的协同过滤；\t（20分）\n",
    "3.\t实现基于模型（矩阵分解/LFM）的协同过滤。（30分）\n",
    "4.\t对每种推荐算法的推荐结果，用Top20个推荐歌曲的准确率和召回率评价推荐系统的性能。（30分）\n",
    "\n",
    "\n",
    "注意：\n",
    "1.\t如果内存有限，对每个用户，可考虑只推荐最流行的5000首歌曲。从triplet_dataset_sub_song_merged.csv中抽取播放次数排在前5000的歌曲。Recommendation_Item_CF.ipynb文件中已有抽取数据的代码，后来老师又发了一份前800个用户及800首歌曲的文件，本作业以此份文件为准。\n",
    "2.\t由于这个数据集中并没有用户对物品的显式打分，需要将播放次数转换为分数。\n",
    "3.\t在协同过滤中计算用户之间的相似度或物品之间的相似度时，一种方式用播放次数/分数作为用户/物品的特征表示，同课件。可考虑将播放次数变换到[0,10]区间。\n",
    "另一种可选的表示是只要用户播放过歌曲就表示为1，否则为0（二值化），这样物品之间的相似度为播放两个歌曲的用户交集除以播放两个歌曲的用户并集：\n",
    "。\n",
    "类似的，两个用户之间的相似度可用两个用户播放歌曲的交集除以两个用户播放歌曲的并集表示。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 导入工具包"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:00:08.145126Z",
     "start_time": "2018-11-15T02:00:04.826936Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#保存数据\n",
    "import pickle\n",
    "import itertools\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import scipy.io as sio\n",
    "import scipy.sparse as ss\n",
    "from collections import defaultdict"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 读入老师汇整后的前800个用户及800首歌曲的文件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:00:08.348138Z",
     "start_time": "2018-11-15T02:00:08.151126Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "tripletDatasetSub = pd.read_csv(\"triplet_dataset_sub.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:00:08.504147Z",
     "start_time": "2018-11-15T02:00:08.358138Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user</th>\n",
       "      <th>song</th>\n",
       "      <th>play_count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOCKSGZ12A58A7CA4B</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOCVTLJ12A6310F0FD</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SODLLYS12A8C13A96B</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOEGIYH12A6D4FC0E3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOFRQTD12A81C233C0</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOHEMBB12A6701E907</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOHJOLH12A6310DFE5</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOIZLKI12A6D4F7B61</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOJGSIO12A8C141DBF</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKEYJQ12A6D4F6132</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKLRPJ12A8C13C3FE</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKNWRZ12A8C13BF62</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKXYUW12A8C140229</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLAUOW12A8C13A400</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLLDVS12AB0183835</td>\n",
       "      <td>6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLOZRE12A8C133256</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLWRZI12A6D4FC4F0</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMDVSL12A6D4F7230</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMGIYR12AB0187973</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMNGMO12A6702187E</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMRYYN12A6310F0F3</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONDCOR12A8C13BA16</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONQBUB12A6D4F8ED0</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONYKOW12AB01849C9</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOALOT12A8C13ABD9</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOKGRB12A8C13CD66</td>\n",
       "      <td>4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOSJIV12AF729E09E</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOZFCC12A58A7D783</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOPBXPQ12AB01887E2</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOPCTBB12AF72A1B64</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>70</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOTWNDJ12A8C143984</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>71</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUFNSM12A58A77715</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>72</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUFPNI12A8C142D19</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>73</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUGCDK12AC95F075F</td>\n",
       "      <td>8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>74</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUGLIK12A8C143DF4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>75</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOULBNJ12AB01851E9</td>\n",
       "      <td>3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>76</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUNJIO12AB0181339</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>77</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUQQWB12AB01828AB</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>78</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUSAXA12AF72A73F5</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>79</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUUJMQ12A8C141D32</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>80</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUVTSM12AC468F6A7</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>81</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOUZBUD12A8C13FD8E</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>82</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVALQH12AB0189114</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>83</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVCHUK12AB017F41F</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>84</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVDLZN12AB0185BEA</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>85</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVIZNF12AF72A710A</td>\n",
       "      <td>5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>86</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVLJHG12A81C21AA0</td>\n",
       "      <td>7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>87</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVMOCU12A8C140E82</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>88</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVNVRF12A8C14477B</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>89</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVPBLT12A6D4F5113</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>90</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVRTPN12AB0184F9E</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>91</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVRZIX12AAF3B2A32</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>92</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVUBST12AB018C9A4</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>93</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOVWHPM12AB017DABB</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>94</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOWGEWN12A6D4F789B</td>\n",
       "      <td>2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>95</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOWGHHQ12A67021878</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>96</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOWKKGX12A6D4FCC01</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>97</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOWOMMY127F8096DF9</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>98</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOWQXHG12AB0189D1A</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>99</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOWVNWB12A8C133171</td>\n",
       "      <td>1</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>100 rows × 3 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                        user                song  play_count\n",
       "0   4e11f45d732f4861772b2906f81a7d384552ad12  SOCKSGZ12A58A7CA4B           1\n",
       "1   4e11f45d732f4861772b2906f81a7d384552ad12  SOCVTLJ12A6310F0FD           1\n",
       "2   4e11f45d732f4861772b2906f81a7d384552ad12  SODLLYS12A8C13A96B           3\n",
       "3   4e11f45d732f4861772b2906f81a7d384552ad12  SOEGIYH12A6D4FC0E3           1\n",
       "4   4e11f45d732f4861772b2906f81a7d384552ad12  SOFRQTD12A81C233C0           2\n",
       "5   4e11f45d732f4861772b2906f81a7d384552ad12  SOHEMBB12A6701E907           1\n",
       "6   4e11f45d732f4861772b2906f81a7d384552ad12  SOHJOLH12A6310DFE5           1\n",
       "7   4e11f45d732f4861772b2906f81a7d384552ad12  SOIZLKI12A6D4F7B61           1\n",
       "8   4e11f45d732f4861772b2906f81a7d384552ad12  SOJGSIO12A8C141DBF           1\n",
       "9   4e11f45d732f4861772b2906f81a7d384552ad12  SOKEYJQ12A6D4F6132           1\n",
       "10  4e11f45d732f4861772b2906f81a7d384552ad12  SOKLRPJ12A8C13C3FE           1\n",
       "11  4e11f45d732f4861772b2906f81a7d384552ad12  SOKNWRZ12A8C13BF62           2\n",
       "12  4e11f45d732f4861772b2906f81a7d384552ad12  SOKXYUW12A8C140229           1\n",
       "13  4e11f45d732f4861772b2906f81a7d384552ad12  SOLAUOW12A8C13A400           3\n",
       "14  4e11f45d732f4861772b2906f81a7d384552ad12  SOLLDVS12AB0183835           6\n",
       "15  4e11f45d732f4861772b2906f81a7d384552ad12  SOLOZRE12A8C133256           1\n",
       "16  4e11f45d732f4861772b2906f81a7d384552ad12  SOLWRZI12A6D4FC4F0           1\n",
       "17  4e11f45d732f4861772b2906f81a7d384552ad12  SOMDVSL12A6D4F7230           2\n",
       "18  4e11f45d732f4861772b2906f81a7d384552ad12  SOMGIYR12AB0187973           1\n",
       "19  4e11f45d732f4861772b2906f81a7d384552ad12  SOMNGMO12A6702187E           1\n",
       "20  4e11f45d732f4861772b2906f81a7d384552ad12  SOMRYYN12A6310F0F3           1\n",
       "21  4e11f45d732f4861772b2906f81a7d384552ad12  SONDCOR12A8C13BA16           1\n",
       "22  4e11f45d732f4861772b2906f81a7d384552ad12  SONQBUB12A6D4F8ED0           3\n",
       "23  4e11f45d732f4861772b2906f81a7d384552ad12  SONYKOW12AB01849C9           2\n",
       "24  4e11f45d732f4861772b2906f81a7d384552ad12  SOOALOT12A8C13ABD9           5\n",
       "25  4e11f45d732f4861772b2906f81a7d384552ad12  SOOKGRB12A8C13CD66           4\n",
       "26  4e11f45d732f4861772b2906f81a7d384552ad12  SOOSJIV12AF729E09E           5\n",
       "27  4e11f45d732f4861772b2906f81a7d384552ad12  SOOZFCC12A58A7D783           1\n",
       "28  4e11f45d732f4861772b2906f81a7d384552ad12  SOPBXPQ12AB01887E2           2\n",
       "29  4e11f45d732f4861772b2906f81a7d384552ad12  SOPCTBB12AF72A1B64           1\n",
       "..                                       ...                 ...         ...\n",
       "70  4e11f45d732f4861772b2906f81a7d384552ad12  SOTWNDJ12A8C143984           2\n",
       "71  4e11f45d732f4861772b2906f81a7d384552ad12  SOUFNSM12A58A77715           1\n",
       "72  4e11f45d732f4861772b2906f81a7d384552ad12  SOUFPNI12A8C142D19           2\n",
       "73  4e11f45d732f4861772b2906f81a7d384552ad12  SOUGCDK12AC95F075F           8\n",
       "74  4e11f45d732f4861772b2906f81a7d384552ad12  SOUGLIK12A8C143DF4           1\n",
       "75  4e11f45d732f4861772b2906f81a7d384552ad12  SOULBNJ12AB01851E9           3\n",
       "76  4e11f45d732f4861772b2906f81a7d384552ad12  SOUNJIO12AB0181339           2\n",
       "77  4e11f45d732f4861772b2906f81a7d384552ad12  SOUQQWB12AB01828AB           2\n",
       "78  4e11f45d732f4861772b2906f81a7d384552ad12  SOUSAXA12AF72A73F5           2\n",
       "79  4e11f45d732f4861772b2906f81a7d384552ad12  SOUUJMQ12A8C141D32           5\n",
       "80  4e11f45d732f4861772b2906f81a7d384552ad12  SOUVTSM12AC468F6A7           1\n",
       "81  4e11f45d732f4861772b2906f81a7d384552ad12  SOUZBUD12A8C13FD8E           1\n",
       "82  4e11f45d732f4861772b2906f81a7d384552ad12  SOVALQH12AB0189114           1\n",
       "83  4e11f45d732f4861772b2906f81a7d384552ad12  SOVCHUK12AB017F41F           1\n",
       "84  4e11f45d732f4861772b2906f81a7d384552ad12  SOVDLZN12AB0185BEA           1\n",
       "85  4e11f45d732f4861772b2906f81a7d384552ad12  SOVIZNF12AF72A710A           5\n",
       "86  4e11f45d732f4861772b2906f81a7d384552ad12  SOVLJHG12A81C21AA0           7\n",
       "87  4e11f45d732f4861772b2906f81a7d384552ad12  SOVMOCU12A8C140E82           1\n",
       "88  4e11f45d732f4861772b2906f81a7d384552ad12  SOVNVRF12A8C14477B           2\n",
       "89  4e11f45d732f4861772b2906f81a7d384552ad12  SOVPBLT12A6D4F5113           1\n",
       "90  4e11f45d732f4861772b2906f81a7d384552ad12  SOVRTPN12AB0184F9E           1\n",
       "91  4e11f45d732f4861772b2906f81a7d384552ad12  SOVRZIX12AAF3B2A32           1\n",
       "92  4e11f45d732f4861772b2906f81a7d384552ad12  SOVUBST12AB018C9A4           1\n",
       "93  4e11f45d732f4861772b2906f81a7d384552ad12  SOVWHPM12AB017DABB           1\n",
       "94  4e11f45d732f4861772b2906f81a7d384552ad12  SOWGEWN12A6D4F789B           2\n",
       "95  4e11f45d732f4861772b2906f81a7d384552ad12  SOWGHHQ12A67021878           1\n",
       "96  4e11f45d732f4861772b2906f81a7d384552ad12  SOWKKGX12A6D4FCC01           1\n",
       "97  4e11f45d732f4861772b2906f81a7d384552ad12  SOWOMMY127F8096DF9           1\n",
       "98  4e11f45d732f4861772b2906f81a7d384552ad12  SOWQXHG12AB0189D1A           1\n",
       "99  4e11f45d732f4861772b2906f81a7d384552ad12  SOWVNWB12A8C133171           1\n",
       "\n",
       "[100 rows x 3 columns]"
      ]
     },
     "execution_count": 3,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tripletDatasetSub.head(100)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 整理这800个用户对歌曲的打分"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "因为只有播放次数与歌曲有关系，所以只能用播放次数的比例来代表分数，即用户的喜欢程度"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 先计算上面读进来的数据的总行数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:00:08.573151Z",
     "start_time": "2018-11-15T02:00:08.519148Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "37519\n"
     ]
    }
   ],
   "source": [
    "totalLines = tripletDatasetSub.shape[0]\n",
    "print(totalLines)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 计算每个用户各自总的播放次数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:20.860285Z",
     "start_time": "2018-11-15T02:00:08.583151Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#score_For_UserToSong = defaultdict()\n",
    "totalCount_For_EveryUser = defaultdict(set)\n",
    "for i in range (totalLines):\n",
    "    play_count = tripletDatasetSub.iloc[i][\"play_count\"]\n",
    "    if tripletDatasetSub.iloc[i][\"user\"] in totalCount_For_EveryUser:\n",
    "        play_count += totalCount_For_EveryUser[tripletDatasetSub.iloc[i][\"user\"]]#重复出现的用户就要不断叠加\n",
    "    totalCount_For_EveryUser.update({tripletDatasetSub.iloc[i][\"user\"]:play_count})\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "看一下结果"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:21.015294Z",
     "start_time": "2018-11-15T02:01:20.870286Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "defaultdict(set,\n",
       "            {'0025bfe6248070545d23721083acd3f60451da4f': 52,\n",
       "             '002b63a7e2247de6d62bc62f253474edc7dd044c': 686,\n",
       "             '003a5e3285141b1a54edbc51fbfa1cc922023aae': 655,\n",
       "             '0084ecc8a2b3b0a371b968ded8b92d3d8525fd64': 33,\n",
       "             '0091e0326c4c034cc04be6454742912845740a1f': 230,\n",
       "             '00a55d1ba6f63109c208dbd80570520d5d80f563': 29,\n",
       "             '00d7dede8a10a03ea0b2d4a08449a9776d414923': 178,\n",
       "             '00fa0c8162aa95341f4da9defede8aae0675d3cc': 600,\n",
       "             '010a2a11d5013b81195a4b2c5b4ef8996a60f4a9': 32,\n",
       "             '01a957fd771b0e80ef7843684217cad5939b4add': 212,\n",
       "             '02471b044e6bdff7c01e1ea2791214268ba5aaf4': 362,\n",
       "             '0252acdea2a493da2704c23eebaeaa155b18b7d0': 933,\n",
       "             '0298a31b3535c3a3f972bc0d342cfc207c3cd8a6': 248,\n",
       "             '03699fa50d944261dd0fe6eb6c4b58cbb44bdae5': 13,\n",
       "             '04043d5716a2359f49f62d13c7c3d3e72b28f520': 212,\n",
       "             '0421d096b0c80ec287d436e6f535f44b711b58ef': 1017,\n",
       "             '0469bfcd3e17b383cbf1a362af8844a44339998d': 671,\n",
       "             '04ba112cdf196358a56d6bdbf453bb0b2eb50b1c': 1468,\n",
       "             '05be6a588cc454d1e400a358c562807aeec8c054': 223,\n",
       "             '0618bf6227486c545a548a649d32cee247dd198d': 269,\n",
       "             '062eef2a03b53d2b10f5018135e3361659c6a3bf': 208,\n",
       "             '074a2197ff72db9f7e44606dfd33208dcdf29f06': 70,\n",
       "             '083a2a59603a605275107c00812a811526c2a0af': 1081,\n",
       "             '093cb74eb3c517c5179ae24caf0ebec51b24d2a2': 296,\n",
       "             '0a4c3c6999c74af7d8a44e96b44bf64e513c0f8b': 643,\n",
       "             '0a66acea5854a05a1514cd259124433b4190534a': 97,\n",
       "             '0aae6978a0342cf0c356aa8a28ec6516df684025': 311,\n",
       "             '0ab9d9f7925520801fffa8b63287d799cfe9a5a4': 400,\n",
       "             '0ad0283d63a5c591a104142f8a2f5bbd779389b0': 98,\n",
       "             '0adc1da3be9d2c9fa26d21268713fe4030402781': 232,\n",
       "             '0aff84b7bed6c66ccf83a456a3b69d8662643ea9': 263,\n",
       "             '0b19fe0fad7ca85693846f7dad047c449784647e': 2177,\n",
       "             '0bddd6707477153b58e187ff937caf70ca1d5f62': 799,\n",
       "             '0bf4f659dff8389645155ecd66457befe81b8b1d': 97,\n",
       "             '0c2932cb475b83b61039bdfbb72c14580b8fad2b': 970,\n",
       "             '0c68affd09224b5231f656c31aec29505da2f661': 349,\n",
       "             '0d54fad06b250c41865f6af5b8d35dd5c5750c75': 666,\n",
       "             '0df611264438223e25d81a81f4269473263ead62': 223,\n",
       "             '0f9ff24431527748aa98d5bc979e22b48a658ec3': 232,\n",
       "             '0fb08af6e4cd85e39f0c939097792a95be3431ee': 778,\n",
       "             '104bcda48463a99997f668b897c32234793cd514': 335,\n",
       "             '109eddbad1b4771c8a1a50899a5d1a91cfff69fa': 834,\n",
       "             '11089077167c838f036384933d6c0ecafce6814b': 225,\n",
       "             '113255a012b2affeab62607563d03fbdf31b08e7': 626,\n",
       "             '1198e6c8673f603114e7de4b1045a6cc6e80c897': 13,\n",
       "             '119b7c88d58d0c6eb051365c103da5caf817bea6': 2477,\n",
       "             '11cfd7a90f8f80eea6520ecd1f6ab853fb837292': 28,\n",
       "             '125878fa33947aaf4a8cdb1fb4843298f31a0ae0': 378,\n",
       "             '1272d32979a6ecd4f8b48cf25c9738c2298e0b4f': 141,\n",
       "             '1280b7963657a12b28a8ca58bf736ddeb256fda1': 528,\n",
       "             '138d73356c23e6e12aa82fb5dc9225428c196464': 361,\n",
       "             '13a2d690b099bcd3fdd256bd39aa14edadd5db08': 658,\n",
       "             '13ce57b3a25ef63fa614335fd838e8024c42ec17': 61,\n",
       "             '145f15885973e477a91d2fc560a63850622e0d9e': 361,\n",
       "             '146ad3a976414133d661a070b20f62edfc958d52': 135,\n",
       "             '14704dda3b07d77a3ec68db2252c7c713553fcc0': 228,\n",
       "             '148163a8a9c6173a11fb36c3215c1a19251e63c8': 728,\n",
       "             '14b0f0d6e70257720525813d3fa4ff60904cf6f3': 124,\n",
       "             '15b447e75c02e91a9d8ce92fd6f2d1366d07d380': 288,\n",
       "             '15e7692a0539b165bbe0dad78dea78e2ba5fb37f': 177,\n",
       "             '168afb3dd9c92b4724171543c1c123aa26dd4cd1': 134,\n",
       "             '168db3745c3e7255a1ef0e759fa4e413e5ba9dfc': 7,\n",
       "             '16a169fe2aae8b9def552092527db97a412bee7d': 102,\n",
       "             '174b880b7340e2921b281493cfc6337bb7d99579': 182,\n",
       "             '17d3104690880b6fbc4e347414c3999fa5df155a': 275,\n",
       "             '1820cfffd52cad7b3af398f379524d51579655d2': 455,\n",
       "             '1854daf178674bbac9a8ed3d481f95b76676b414': 149,\n",
       "             '18765abd13462c176d9ccc89e71bfc23265dfed7': 126,\n",
       "             '189f3d247c01e8319458d82ed68cbaf3112fe9fb': 1060,\n",
       "             '18c1dd917693fd929e3f99dd7906c2aafe9ff17f': 1172,\n",
       "             '18d857219b6fedae682aa3a5e2be18ec526ab241': 851,\n",
       "             '18ef1900567a7ade3b085f6d1c6de4ddcef2f3c8': 197,\n",
       "             '19546df993c6dd9eb73413e1d7687ae1bdfc9ad1': 310,\n",
       "             '1991ec49e285545363025ffcb4988c6dd860c766': 339,\n",
       "             '19d2a7ccba17143f6b0425fc9c62a5f8df8455f7': 427,\n",
       "             '19e3b4d5aecb41ce9906d1587f565eac9c33ba35': 227,\n",
       "             '1a3cebe4f11f71abf431387fb5854423052e93db': 1345,\n",
       "             '1a3da397d1e12c93dfcc4dba418432bee5be3dfe': 735,\n",
       "             '1a43a7b1bf9a79e34aa16694ebe298454b53a3e6': 235,\n",
       "             '1a6916b63039c3c56c62de345c284c11a075eb96': 655,\n",
       "             '1aa4fd215aadb160965110ed8a829745cde319eb': 272,\n",
       "             '1b7f854554b1720763e7b02470ba8d35b54c4358': 284,\n",
       "             '1ba976595e1484dfe7d5ce29231922ca1b0dbd27': 148,\n",
       "             '1c63c64dd51057426690f3d5ad7346c8cf25c78e': 573,\n",
       "             '1d36c586adf56c1be114fb173bf23ececa79e9c7': 194,\n",
       "             '1db9458849024e54f89a807790230aa5701f112d': 119,\n",
       "             '1f91494ea547a8eb6168ba08735a667667c47e04': 466,\n",
       "             '1fbb0f6de552dec6eff67288fbaf3efeae2a2427': 348,\n",
       "             '1fc2a7f42424249718cc544a0a1036a69d5bc7b8': 395,\n",
       "             '1ff6d6bf0ec7ad1c288a48d6e06fd5ad708877d9': 648,\n",
       "             '202bb41761c1a0224eda4810f7473044dc924da9': 444,\n",
       "             '20ad98ab543da9ec41c6ac3b6354c5ab3ca6bc5e': 429,\n",
       "             '20ecc83aa91f1aa3f08ec0e7c21777f8d85ee7e5': 482,\n",
       "             '20f9552042cb42a7a2c1d68049ebf9120fee7df8': 263,\n",
       "             '2102cfa15b3702123d179c1559717e1886170139': 274,\n",
       "             '211386f02e7e027ab0b1d16de4a6311f43179974': 74,\n",
       "             '21539fbf4195cc3984ae8dccfb703cc20437fcdf': 397,\n",
       "             '21aaf8482f3a05f757e321f7fc981ffdf52c950b': 623,\n",
       "             '22078df22561beeee86e9a9c33fe265a7a23eaa5': 127,\n",
       "             '222542d2ce54e6949f9346d331dd8a028b044826': 307,\n",
       "             '2231cb435771a1a621ec44e95cdd28b81fad3288': 679,\n",
       "             '22e08d5e101ab5b86dc394856d508e175a5242a6': 118,\n",
       "             '22f6aae94643c2cea285413068f80274e7f1f75e': 1696,\n",
       "             '22fff4185bb0de9ea6d28a471f388c3a072817c5': 35,\n",
       "             '23563d3fc5aa322fded41b295e36291473515771': 476,\n",
       "             '23ec7765590efc05002ccf6551cbadaa953c2069': 113,\n",
       "             '2401e90ee6a2796f74cf01c5e808ae8a0540ad61': 1185,\n",
       "             '2512a3b507a0d6f410b1f7833ad2b989e7234962': 231,\n",
       "             '25882dd48e8b21d31242bb54d4a261e907dbf96a': 97,\n",
       "             '25f202e6e02803d3e2f19fea3f88293e24483196': 347,\n",
       "             '25f83a09541073b1bde62e6e513cb938d3b148de': 1334,\n",
       "             '261ea96dea056f44efc267d6fbc5718240aa82b0': 449,\n",
       "             '264d3d0dcbb2978dc315007890c34e62c76e14f7': 231,\n",
       "             '2668af52749df405c6eee58d41c8afd434f617e2': 103,\n",
       "             '266d39cb5358ed2b9fded91bebb88e075bcf514e': 844,\n",
       "             '26d74cbc4f61ec6078ebcb70d029304cc7b8bc98': 429,\n",
       "             '2744a71984cdf296fb94de2b9d5aa0f065ffb1ab': 1096,\n",
       "             '275fea3955a0351c588e0f80557c54092afda8bd': 417,\n",
       "             '28072dd1efa8a37ebfe6f70cffe91e23d9073d3c': 300,\n",
       "             '281deab3afccc906251ef67a8eda2b9f9baec459': 1844,\n",
       "             '283882c3d18ff2ad0e17124002ec02b847d06e9a': 903,\n",
       "             '2a2f776cbac6df64d6cb505e7e834e01684673b6': 233,\n",
       "             '2a3d80f37b92fa113d4f4b0785d797153cca5f63': 397,\n",
       "             '2ae63e708b3763e4808d355fe962b954048d00ce': 1140,\n",
       "             '2aefbf7a59ecb4c84812b3ca70d2b5e78398d79a': 448,\n",
       "             '2b04ee89ef77af7d11abf3077e366d1599656232': 83,\n",
       "             '2b3e60309a89ea57df2f9ffe7dcb5871fcc8bc83': 153,\n",
       "             '2b53775d73eb78e9634f7ae41629386ab11bac1f': 660,\n",
       "             '2b77760cb7cf72d64dd6d5bdf8a5c195a044a9b3': 429,\n",
       "             '2b8b819c92836d86d891d2c41bd25fdffd759898': 224,\n",
       "             '2b8bfcdc258cdfe9dce9991d67786b3cebbc3b22': 789,\n",
       "             '2bc9df66877af6eddb7103859a574615f0a8aa91': 935,\n",
       "             '2be4230290a6fb2964fd80fb40974fb8b749e28f': 138,\n",
       "             '2be94fe8976330172517c748780600f38ff55c2c': 1032,\n",
       "             '2bef5a8a906d8cbac97c0ba12cfd41fc234e8832': 26,\n",
       "             '2c04736f4d7b0696d2a063b1e61069af38660a94': 251,\n",
       "             '2c2790c0ce23f00f1b642fd356ec6854a133d083': 610,\n",
       "             '2d1d1596c8d162b33ce8bdb575dae8073afa1086': 103,\n",
       "             '2e21c7fa3c52a4f3b33019601d67fbdfc12626a6': 96,\n",
       "             '2e259fa6ebcc8b4df0ee93b8a9b94f3dce8b4272': 428,\n",
       "             '2eb0876f28b485ed457921f6514079bf6be1e0cf': 415,\n",
       "             '2f72cbcbf49aac438f614626d86c5e93efb82206': 197,\n",
       "             '2fa58dbe45db621eadad025c7bf3e30957eee321': 481,\n",
       "             '30cc99a1b03a19cc162b286c76047e58371ffb3d': 80,\n",
       "             '315213e4a0e89abdd69633c46f83b6e1dc0e8d87': 55,\n",
       "             '31aad1036a404737ee8b88ea2da68813c9a46874': 825,\n",
       "             '31cbbdbd5a1a6ef64601dee9144c7c20494452a7': 1730,\n",
       "             '32059ac26f8d04aac58d7cb013d40a1218a54792': 311,\n",
       "             '324de4a258619466993c3bd75f340bc19e82bc62': 139,\n",
       "             '3288389bf9ef956a23a0a4ea86f60bf24ba7f69e': 80,\n",
       "             '32e46bf89e523d8261aab60b31a766a4d24af83e': 388,\n",
       "             '330a7b1168a732742b572ba38a186c5b951b7f2d': 407,\n",
       "             '3325fe1d8da7b13dd42004ede8011ce3d7cd205d': 1732,\n",
       "             '3379f558a480a79694e02d7f5b079f9a647896b6': 1040,\n",
       "             '339fbf843dcf3f7ec3a7f43c37b6a1ff37f5b817': 1065,\n",
       "             '33a1286454a3cff06e3c2324be746d2e23d7c270': 96,\n",
       "             '33db1f9a79d6400c01112f2b4897eeee533b1b8b': 79,\n",
       "             '33e3fc88b0ab07f872bf7515413887374dd76ad6': 73,\n",
       "             '33e54fd5947474ddce07fb284ac469d9664e7a73': 1222,\n",
       "             '353e70f6690406aad7e51706bfd9df6aaab7ec55': 287,\n",
       "             '358e0fdc1b9d9a219ccea844b58bd8e6e35f0533': 37,\n",
       "             '35b1d8452b62242a2ded2dc5ea05a0a407023cf7': 514,\n",
       "             '35fcd4682de9c5da1291058a22910aca0bb6f106': 88,\n",
       "             '360dfc77809fc2f4a5863eb59bcf4191de6635ef': 276,\n",
       "             '36bee226881241a38e3c9997cf0c84e2959035e7': 488,\n",
       "             '371e9aff6b9f644e7598dbc4dd5640b1544b97f3': 423,\n",
       "             '37e0e4c4cb5b1e6022908bd129f70c70e08ac68b': 626,\n",
       "             '38652d8717caedb30d026fbcada4bb6e006903bf': 247,\n",
       "             '3877e44d4632df125ec8a838aae59eb04d36f9d6': 362,\n",
       "             '38ae280090905f0778dd40727f89de3380fb2625': 29,\n",
       "             '38e4d46aaa581c4ec558c4e76e613dec9947c7e4': 33,\n",
       "             '3907d4fe152c83b3aeaa28b294f23daf072eca46': 89,\n",
       "             '3931fe199c4c42920ed84d72f57196d6c6046878': 335,\n",
       "             '39507f8b1baca174ccb5b1c9c08dd46a05442350': 596,\n",
       "             '39797b8781fee9c03a218afddda0a4759dabc937': 15,\n",
       "             '3996245591e28d4ab3fc572cae1c44c456e2fa34': 367,\n",
       "             '39d55eedc1948ad9957d08ee36c24a448f804e39': 125,\n",
       "             '3a11e6d1f8aa60342e2486922edf199deadb2026': 7,\n",
       "             '3a34be849c7377037ecb43666ca8aa5988197128': 96,\n",
       "             '3a6553c25f5dce3dbbbedc429496d40bf913e354': 124,\n",
       "             '3a7b8d494de0d2ee3466c172e4713acaa1f27131': 186,\n",
       "             '3ab78e39bddeaeb789edad041fff03050077417c': 9,\n",
       "             '3b4bb393138bba331e3dde43dfdc05554f05a743': 28,\n",
       "             '3b4dcd2b3b07e9c2fd9467c9bcefef64ac779fc4': 117,\n",
       "             '3b93435988354b1889de1e71810d1dd65c4ba17c': 391,\n",
       "             '3bcd2749896db47dec4ea21cbca3494e3c5560c1': 1205,\n",
       "             '3becbc727a8572453d170c909829fda9e6d00554': 390,\n",
       "             '3e23f6f35c51bfd4b1d38595e59e0afa26427a02': 54,\n",
       "             '3e6dd161e97e7bd0e20986e7f5e391e5d24e0a62': 129,\n",
       "             '3ec9172d9c2dfaf26efdb6cc24edb468353b7be8': 136,\n",
       "             '3f1037fb3a74f351cd61fff169a54896d2be06f9': 78,\n",
       "             '3fa44653315697f42410a30cb766a4eb102080bb': 2696,\n",
       "             '40436a67317cf9cc8c835cdbc088222f932ca3b1': 712,\n",
       "             '40512c7d4dbe8126c88a794a8bc7bf094b401d64': 202,\n",
       "             '40518f9fa3258e81af0c8d5b0ebee81bb36a4251': 408,\n",
       "             '40534737aa2c6eb14a9e5a8358cd133e64ef4ff9': 236,\n",
       "             '405d56f9ee607686b459a6d9ca2d3c5ac2201fe1': 170,\n",
       "             '40e46bab2caa78cfe7150218f53ab7aed69a7b1e': 29,\n",
       "             '40f17e888c48cce4ff9b211b6babc5f95904e7bc': 140,\n",
       "             '417bb8a7234014d0bdfa19e1e65e49936eb296ff': 37,\n",
       "             '41d990857d4659738215aadddb0d6e630685d278': 100,\n",
       "             '42060428606a89dafa75e9311b8e77859766fcb0': 338,\n",
       "             '421a43936c80f2232747bdcf340e2744fdf37aa6': 1044,\n",
       "             '421e2927fcc64aa9d90b4120cd93cb3c682b749d': 166,\n",
       "             '42ac141a65053a2ba02c5380ccf7975022e307a6': 378,\n",
       "             '433f907cfd7e5febc71200438c107ee3989d6fac': 500,\n",
       "             '43e241eaa4d079ab2bdbd30231695f5563583af4': 268,\n",
       "             '4403518f697ae745538e83317ed66b0f5b09a356': 35,\n",
       "             '4468ce74671606114d8fe94ebbd928b9e925d049': 573,\n",
       "             '44bf2bb66daf59a20d7b7df64fda29ec16c74cb9': 254,\n",
       "             '44dbe546fd09a446e91532250a01df377f4ab85f': 1391,\n",
       "             '44ec3ce6ed442ea08e7872cba62489f5b0ed08ec': 138,\n",
       "             '4552b85a1b315556ad50d4a10942a3e86fc7d72c': 1247,\n",
       "             '45d34f6b12ce922136ea7c6a82de3524be24d683': 27,\n",
       "             '45f06d9d15adbd8575a63e848b1f1c202afbf308': 640,\n",
       "             '4626aa787c5e156440970cc12f9ecad4cde3f06b': 265,\n",
       "             '46367bcdb3f6eb49bb5822d749d47f28cf91c041': 248,\n",
       "             '467e0e46181933c7e1a936e513ca55fbab4edaed': 16,\n",
       "             '46fe52b28ab1afc6c99a13af8c0c722e534cefbf': 115,\n",
       "             '4748dd6561d01b44a5add4c9e1e4282f1578bdcc': 1219,\n",
       "             '47ea89d3c206dc77960177b663e3a21ae39d28a1': 195,\n",
       "             '480f3a551bbcdb53f8eb28e44614aa7ce0cc8d0e': 377,\n",
       "             '484734ce6667a6a25df23a961d5c5a9458afbfa1': 372,\n",
       "             '48567d388c6a7dda0e9d0a7b6648bdb42440475c': 682,\n",
       "             '486a5615473bfccae823c0538dd22dffbf986ff4': 260,\n",
       "             '486c99dddf3555a2422a4e122b72f2ad0aed194c': 337,\n",
       "             '49127655d27dabab3f469bcdd996330fe4f3e210': 1805,\n",
       "             '491d048e26c51fcda0744355bf191d4ccf36f118': 191,\n",
       "             '49b142551f26ec13c3376b1d5601eff26649927c': 311,\n",
       "             '49c8369971513c689d0ca6d0382e5c5a710df7e7': 1089,\n",
       "             '4a3c29a00b09fc26fccf843c8c52bdd74f19cf32': 81,\n",
       "             '4aa35a6181dc8ba9635790467dcf4f0d57fee0c0': 395,\n",
       "             '4ae01afa8f2430ea0704d502bc7b57fb52164882': 1386,\n",
       "             '4b8f0ccc6ff139b072eaeb5e19654177aaffb416': 86,\n",
       "             '4bcc4cfd9acf7e19bbccd398f8503ba79fb66513': 635,\n",
       "             '4be305e02f4e72dad1b8ac78e630403543bab994': 3868,\n",
       "             '4be63160ad51eb4c19c3ba70bf097b729d929650': 108,\n",
       "             '4c6426c9c734c23ec0c35154437fc132b862068c': 409,\n",
       "             '4c6c5c381582e55c835de338dab42c9ea1cb9c00': 76,\n",
       "             '4cb4632e48cd8960dc113eae340adc402a0413cf': 459,\n",
       "             '4cbca37009400bb5676ba54c2a4cc24ff0531cb7': 1057,\n",
       "             '4cf9722427d38047fe018ff035305f2ff3398dee': 211,\n",
       "             '4d744903c553122fb4815d06e047aba9f974b938': 148,\n",
       "             '4d905807e921aadd4995b5e3493d6a44863c84e5': 287,\n",
       "             '4d98756ff69be79de228c15432245766d4bf0316': 401,\n",
       "             '4dac0f02b38f49be89ade787020308053fa7f5b7': 96,\n",
       "             '4e11f45d732f4861772b2906f81a7d384552ad12': 259,\n",
       "             '4e73d9e058d2b1f2dba9c1fe4a8f416f9f58364f': 748,\n",
       "             '4ea4ef23853df11d4321bc458471a7b42aeb54cf': 667,\n",
       "             '4f9827b79319210f9e35259bce0587cf04f74a03': 79,\n",
       "             '4fb11828f0a9b7a38f767673ce9a431e347a9ca7': 218,\n",
       "             '50a645c50e28dc80db4fa079a8152db4cce82e8f': 353,\n",
       "             '50eed1070306bacbc9e689e157d70dcf1de73154': 280,\n",
       "             '510f6fb2dcf2aee3a65cbd79fff752e9259f0a13': 405,\n",
       "             '51737e957624c4dd888ae6ea6cd066754e43553f': 154,\n",
       "             '520bb6f7bd2fc51d02f236398acdc5170cc299a8': 209,\n",
       "             '52a6c7b6221f57c89dacbbd06854ca0dc415e9e6': 43,\n",
       "             '52c79ed4030798e03f90cc2f46de9a92b7537c92': 382,\n",
       "             '53006f973449ada11eb09dee2b39f6a0e80cb286': 1006,\n",
       "             '5339907639d69d89e0447aad8e0277d5e455dc76': 511,\n",
       "             '53456e59daa8f3a8498880dbebf595ae02be9de9': 311,\n",
       "             '53771566508ad47219a8d929ecf15ff577fecba6': 266,\n",
       "             '53cc3e95468819addbfcaa1256b460984c581be3': 27,\n",
       "             '53e82dff22cb46bba4f61688225505c1456b9e77': 451,\n",
       "             '53f5a96ce4fe0b735815c877e225225e95061b1b': 150,\n",
       "             '543818a011c5ef09d85e2bb0c0e8427f83af35e0': 65,\n",
       "             '54d07c4eff369f457c7a5d1c0b9b6c48feb949f4': 340,\n",
       "             '5549a947e5442dcc03413bf96e786e9117b33c07': 90,\n",
       "             '55874081c91a71d9f7a13cd9e9f1538e23874370': 1445,\n",
       "             '5588ce55d35d7c70f06e1928ec0967117c5d712b': 450,\n",
       "             '56092216da5aa5238c745459a32f8b0e25828501': 260,\n",
       "             '57107a3feced24c067db22bce2d59c02d53ad04e': 475,\n",
       "             '57262c4ed3cb3ed2db7cab8c627091757c6437d8': 28,\n",
       "             '57f7c9671c77f73db905344afc45627cfe5cba77': 137,\n",
       "             '580c43024b67ffa6c29fcfa5559c8b3ff69815ee': 668,\n",
       "             '58d29c8e14facc36c16c0bf3e567cd7c9b742861': 153,\n",
       "             '59565a9a2a86c12c54bd887c723a47c7f8ab8090': 18,\n",
       "             '597464c554c28f95c08553bc7336dfaae2b3abba': 408,\n",
       "             '5996aa0d1a973619e5a950c7f9b7f0132e0f865c': 989,\n",
       "             '5a52cd6d11b7303292acfde82fe308189c49d829': 353,\n",
       "             '5a828f20d611efe2d818ca48edf3b792f4e69e66': 1190,\n",
       "             '5aefd8962461ebd457fe063e568c256379266778': 242,\n",
       "             '5b68b39d7c8d66935839aa58121abd46605b34cc': 367,\n",
       "             '5bd7cd97b85c91408ef0134a3f7b15d84e01a24c': 69,\n",
       "             '5bf800bef870a6c00532a1e67a15a715f80a7184': 822,\n",
       "             '5d3b42058e500c305c8da67831ba1284693c5cc5': 21,\n",
       "             '5d5a27d2fe3d45e515e79ddb7f70822ef5cd3600': 407,\n",
       "             '5e4783b839d270419d7959ad49bd9402f154a7b4': 1182,\n",
       "             '5e53fe2ce11639e43554127e893dfe3b1b8cb1be': 182,\n",
       "             '5ea28f4b779e99065f325b84cce5b7be855f6e82': 113,\n",
       "             '5ea608df0357ec4fda191cb9316fe8e6e65e3777': 381,\n",
       "             '5ed1d17b8457236d4869e2bdc023bec260a4be5c': 146,\n",
       "             '5f70f88f209b1ee3ff35d44348e29eab62bca41c': 273,\n",
       "             '5fb2630c42e4a08f4f5456306d547a1de3c60100': 152,\n",
       "             '6049f073c9b55e1f0995902414dd64f41357ffa3': 121,\n",
       "             '60760dee24fde175d395a821aa36dab85a579086': 262,\n",
       "             '6086417a706e339f64f47752b474e9c9596ff66d': 850,\n",
       "             '60a90b3801bb9599b85a8448c6d44589fd1f984d': 20,\n",
       "             '60f135dc19f3583f619aac246182343abc647c42': 212,\n",
       "             '61140d9d59353c0d54d85bd85bf45f4041bee560': 70,\n",
       "             '613081f27b9917e4d0e84639fc02661d809f36e3': 99,\n",
       "             '6221f83782d97a9718f1fd9178f789d29d68e614': 222,\n",
       "             '62420be0fd0df5ab0eb4cba35a4bc7cb3e3b506a': 15,\n",
       "             '625d0167edbc5df88e9fbebe3fcdd6b121a316bb': 597,\n",
       "             '6270f977ebf8da9f90e2ff2d23bc570fa012b5ee': 185,\n",
       "             '627fae8384469c99391b504f9d98030999019e85': 84,\n",
       "             '62d59a3a252b58415e7aececf237de61535b7d5a': 115,\n",
       "             '6326095256b355d4b4fa34771b7b524a1c4cc8f8': 931,\n",
       "             '63aa3e991a33c309016051541b8084ff0aec7284': 160,\n",
       "             '65c23b32ecf7636bd62af8f928967cd0f23b00d8': 229,\n",
       "             '66abc1ae25dca07b75109164f9dacfe33f9572ba': 462,\n",
       "             '66d0881f2441365cf1103a815f58e2aca464880e': 229,\n",
       "             '672bc4a46d39a2e0f71a9a82e79b26efd1d6acbd': 333,\n",
       "             '67874d1a189c83326c529e554be6f7acf55effae': 434,\n",
       "             '67c5b5b1982902d15badd8ce0c18b3278ec4bfc0': 65,\n",
       "             '67f2478f4356a9be264521f64b56db8de22bc9f5': 879,\n",
       "             '68bfa6f926e2b47eefe4ca41a2b1eb7b4d4fc001': 388,\n",
       "             '68dd4bef946528dd641f8e5dab749e0b231c7932': 25,\n",
       "             '690ab317e29d08acb0a11e82eb0f83428cf812f9': 147,\n",
       "             '69963f38f75cedf4029510ba20351fec7bdaede9': 288,\n",
       "             '6a3657565b45f103af50ec87321e36712f098aba': 79,\n",
       "             '6a3a8ceb5ee1eecf8959d40791372381265bf461': 1077,\n",
       "             '6a3ec54b60e6a2d13a074046751f9364319c546c': 777,\n",
       "             '6a46aee45cc177cf8e2025e59d21c7939902deee': 1066,\n",
       "             '6a49ecaa3727df93615074768fe683491d274377': 294,\n",
       "             '6a58f480d522814c087fd3f8c77b3f32bb161f9d': 164,\n",
       "             '6a6d346cc92ee699a765a06fd97db74b864a8129': 2502,\n",
       "             '6a8fb4968a5f3b0a5b3708258e2582f66001b15a': 684,\n",
       "             '6a944bfe30ae8d6b873139e8305ae131f1607d5f': 942,\n",
       "             '6b2787bcf47cfea75b734729cdaddd700137ad5a': 1234,\n",
       "             '6b36f65d2eb5579a8b9ed5b4731a7e13b8760722': 28,\n",
       "             '6b3d5eaba2e55699cb725d0c605c6eca1b302dfe': 1,\n",
       "             '6b50806e254895ec3c9a0cb1bee7ac30d80a0f77': 408,\n",
       "             '6b9ef666e3b10fd428530e519e1a3f68c2fbbd1a': 354,\n",
       "             '6babcd5c5d0d794480580eab45820e489c344a0f': 44,\n",
       "             '6bfaf522b9bfb59370d8adfa7f6093579502d775': 765,\n",
       "             '6c2baa9bfea08ed197d38b9d1606aa5ca57e11ce': 624,\n",
       "             '6c6289326f70321f2b3e072daa44819efc55639a': 698,\n",
       "             '6c8faa430c61308b863c22f322ea9fef161f1be8': 158,\n",
       "             '6c99ae7e53e91f7e839444b2f00c8503a4a10fcf': 174,\n",
       "             '6ccd111af9b4baa497aacd6d1863cbf5a141acc6': 409,\n",
       "             '6d03375e6ac509d21fa58684f6d34fdd924cc13c': 1010,\n",
       "             '6d147ffb9f1b7d7188cdb964dd15093227818421': 135,\n",
       "             '6d625c6557df84b60d90426c0116138b617b9449': 1089,\n",
       "             '6d8d89c2073247e77fd23f8f53f9185a1b05c214': 163,\n",
       "             '6dd66914c6574b719c72cff866c9ba2fb596b3e1': 579,\n",
       "             '6e0a8e9103ad7d68e63d350fbff3386c75613ab2': 686,\n",
       "             '6e15cb4dcfdda600d893d230fb7aba1d9d0ff218': 149,\n",
       "             '6eb4c037657215db0d6f4d37bec84fb491374df9': 318,\n",
       "             '70caceccaa745b6f7bc2898a154538eb1ada4d5a': 1357,\n",
       "             '716ed1ec67d67bfa05db3ffeb641d13f46dca6ec': 14,\n",
       "             '71dac99494dd7439a105d14f7597ae706b19c9ed': 394,\n",
       "             '726da71c2c2ea119119a7957517fccd028d1be76': 404,\n",
       "             '7292940e88718a59e8310c6f53363fd5a76e7651': 450,\n",
       "             '7323c1c0cc06f5f77f61db323d00a0a628092848': 221,\n",
       "             '736083bd7ecd162effb7668cab6c281945762e85': 387,\n",
       "             '738759001498928d8dcb054cd53a1a0cfc200d36': 328,\n",
       "             '73a9b86c602d2ab5eb151b77f58bb6e7315dd7b2': 259,\n",
       "             '73db3f91323a8989a83b886d56dae7c4b5e9f924': 102,\n",
       "             '73f6dede40f8292d2e33e9b8b40910d6bf05ae36': 126,\n",
       "             '752d48df8a89c534e9957d85209837c6a943a14f': 541,\n",
       "             '754f985cb55753e84f1933f3280b06e2bb379847': 863,\n",
       "             '755e9959e1c7efb6893b537d54d9df0ba6447e75': 270,\n",
       "             '7560076aa3ff4c9a46d917262a87a3d830543469': 160,\n",
       "             '761d16dd52a522ab3244374d89bcd56887f5ae76': 90,\n",
       "             '767707cf1a42d06669186ae1fa31ff39427fbf60': 1687,\n",
       "             '770329427afe6a43d67b175060299a66385fafba': 656,\n",
       "             '785d92bda70e913c9e63b35803e2928c9273143c': 124,\n",
       "             '786a152a46afcd722fa2c8aa4c11b6858dcf57fc': 400,\n",
       "             '787520b7886d0044cef96c4582890d05f762f76d': 313,\n",
       "             '7875303e731b91b046ec6fbcd640e0b7d8499753': 9,\n",
       "             '7893479225de4c7d4646e90c9bf15f9f624e2cff': 221,\n",
       "             '78bf7dff0b700e44aff7c638db71b1a14e43e12e': 64,\n",
       "             '78ff529b40fa23594d41b0ea65d74083d21474b8': 411,\n",
       "             '797cbbace429fee2717a14ff992df0acd3990368': 191,\n",
       "             '79a1ba30cec2ee1509f3c2df697916fe901b37e9': 570,\n",
       "             '7a5c1696deb4b6acc6abf6252b996992dd33a2a0': 279,\n",
       "             '7acf37b7dd44f5f0016cd9a6c38d3cb6655c6cbb': 288,\n",
       "             '7aea7fc1f48e8f32b403113baec0c0a8c6086ce4': 108,\n",
       "             '7b01590cce3cb5c11efb729f55551b9ce252a00d': 232,\n",
       "             '7bcddb67f19237b576a04ffba65bbb5436085f36': 199,\n",
       "             '7bdfc45af7e15511d150e2acb798cd5e4788abf5': 523,\n",
       "             '7be76db45f21dcbb68ff9cc55ebeddcb1db71479': 137,\n",
       "             '7c613c77527fc728438c365fdb233769404c3424': 363,\n",
       "             '7c9b8125c230d20b19317aa06a4b3f8415057f88': 97,\n",
       "             '7ce93f17fcdfe671e20526527eaf2a4812462171': 355,\n",
       "             '7d4736c0c05264716e87d7fc825a535e0a01ba6d': 140,\n",
       "             '7d5fe9c4d4e6f93cae8257c3eb582607be33e3a0': 33,\n",
       "             '7daccc9211bfffcb2a3bb3c6b72e689018212748': 96,\n",
       "             '7e40c676afe9ffcb80dfcb62e2acffd26ae21996': 379,\n",
       "             '7e41241058af7545be75fb1e38504520e88a0ceb': 370,\n",
       "             '7e543508a213f4f22e0cb54ecf2df9c370070a28': 208,\n",
       "             '7e80a4beb851feae1f2c16a2779f0e9ff424647a': 1416,\n",
       "             '7e89a43dc229de4259b5a36053de255a6247a773': 110,\n",
       "             '7ffc14a55b6256c9fa73fc5c5761d210deb7f738': 1259,\n",
       "             '8084aef08dffb1c0323bc6af17f80b3cd9e2e7f3': 159,\n",
       "             '80ae8f21a060a7fdb7b5d4bb3d5f3021e624e19c': 28,\n",
       "             '80c5812424adf785c62f2746a0de0e0ef0085f08': 184,\n",
       "             '80f383bf5f6581572f6ccac661727956df49f7df': 435,\n",
       "             '80f3cceeac5a7266b6d3696c04f21925e72bf9f4': 433,\n",
       "             '81193c20d49bfbca4a72eaa1119f6bb2fc4d9e48': 663,\n",
       "             '814dda72451239575dc8675ad72e0b612a3bba5e': 61,\n",
       "             '81f0878d4707a39b4aecb412662f901e706adb35': 81,\n",
       "             '81f8c84c3f2117c0e4ddd751c6672665eb26821b': 368,\n",
       "             '821475e83c0f0cadfe0a30c3eb8034ff5c45f3af': 53,\n",
       "             '82b152c09a94dd4f7d4566080a00be441e3efbd9': 716,\n",
       "             '82c6fd88900f461fd0bd25ea28ebee94a76c66ec': 324,\n",
       "             '82cd7de99ecda208dcd18346892859f35daf0520': 261,\n",
       "             '82fed477acd885cc428c29f1423f1929582d0643': 1296,\n",
       "             '82ffeb77e077cbbfad18957f1ff16960448aa382': 127,\n",
       "             '834235a86e0dcf8cac6fb7c5e716b21383473339': 194,\n",
       "             '83522e9d56c3cda41d1853465f1b05f4c2d07550': 552,\n",
       "             '838a765125d54e760c340f960ca3741c85123fa6': 591,\n",
       "             '839223f11c98e0c8017e8ecd6fc7b8706658c966': 670,\n",
       "             '83b94f1d1bf5581499cc0738807c8c41f3bf6706': 267,\n",
       "             '83b96cbafe0a9522343c83c26cd091d06001a091': 544,\n",
       "             '852e9f7eaca16683424b212a85b7b02ef546353e': 42,\n",
       "             '860fb8adde6bc5718f49cc995a8655be11c6536c': 268,\n",
       "             '865915b55b4b6d355c04cca32cacf107f581dc1c': 467,\n",
       "             '86b32a02bc024a253ca140e2fd17e685607a28ed': 124,\n",
       "             '87024dfca766888f3eb47b2f1b71e2eff60ddb86': 146,\n",
       "             '878f1573ca4769da3bc5f327f2e0b168675b2436': 84,\n",
       "             '87b9680d2db44f901bf79d9a61fb298dbb2a6603': 101,\n",
       "             '87d631b1176d2a1c12a9663314b7d7946445786b': 130,\n",
       "             '89d41a4bf3ebbde797df8b554dcbb0cb08e21bc5': 672,\n",
       "             '8acf4c54a3184e0ff1c4b0655c71f6e0b79906b4': 88,\n",
       "             '8ad6a386e7b601c0072c337ec6f86d084d1ba556': 226,\n",
       "             '8b2f76211d04fa0f91b9f0c8134064b2968882c2': 684,\n",
       "             '8b64bf1db75f427e41133d39955fb3f1a28417d9': 205,\n",
       "             '8c800d6ece52acb6aff6ab60d991d090c84aabdc': 501,\n",
       "             '8c8478dbb04dd12e77e215ee8a65c5c9163afec2': 429,\n",
       "             '8cb51abc6bf8ea29341cb070fe1e1af5e4c3ffcc': 323,\n",
       "             '8cbcb30da89e66b46136dca4f3ab5d70893f7db8': 858,\n",
       "             '8ce501388bc1fa1c67f7563d9b2e13ce4554e375': 138,\n",
       "             '8e399a3abffa6dfa348480690406f88280c7e13b': 85,\n",
       "             '8e89713ae062c7d146bb88c5b551f8d477b7962a': 340,\n",
       "             '8ec7fd0c1acf1dbe44720e5eab44dbe524eb6caf': 981,\n",
       "             '8f60fbacfa3387330c6114aec91aff41adc3379b': 218,\n",
       "             '8f8a2009d4376f3a3a47cc955b3cf89a6e1525c6': 507,\n",
       "             '8fdcfa78f7473417f6c3dce442d2b7f49d1a1a57': 33,\n",
       "             '8febc928241a0c88adca87a428fe0650e902a683': 416,\n",
       "             '90d2fcb1dbe47dc1e9442587e259811a0437a13f': 503,\n",
       "             '90dd8f8ee085608b0f0562ae96a988fc62c618ae': 687,\n",
       "             '91008efedbdb903424a51e3cd18b8b80624dd4f4': 599,\n",
       "             '911cd40f59cabcadc026204b3009bc7f1b2fdfbf': 133,\n",
       "             '912a348c57c5b6004f12cfed976ee4569daefb1c': 258,\n",
       "             '91cf50e35e3fa924450d86ecae248b7cea113f0b': 257,\n",
       "             '91ee487b65406cec50462071a41a83b5d6e99342': 464,\n",
       "             '91fc617d2632f554f364015e6e7fb10f3eacce1f': 150,\n",
       "             '92227472de1d2ed14725adff31cfa56a3f29047b': 110,\n",
       "             '9254a3fdc569428c3b1c3904db36d485c47e2544': 389,\n",
       "             '92d2e8ff105b7b7ddc163e740921cafdbcd815bf': 113,\n",
       "             '93158e3983ffc8945e25c793d93d6b67d46cae9d': 97,\n",
       "             '934438129c278fe6bb3de6a3275dba13891674ab': 861,\n",
       "             '93743199681d206189b5288a3cb421970e4cd872': 220,\n",
       "             '9381077c40f2fec40abfc95cb7bede3f6969cdbe': 537,\n",
       "             '94381c9d81f0c76563707de2ce2b2ace5a5be398': 242,\n",
       "             '944cdf52364f45b0edd1c972b5a73d3a86b09c6a': 148,\n",
       "             '94d3dcdd520f1f2f1daec98d1f3736bcff751654': 114,\n",
       "             '951976e7c0d096e83cfbef63febae9332c862556': 38,\n",
       "             '952130c8ae0527458c75471812dbb5c506b46d5d': 307,\n",
       "             '9535d0f428a17456258c0e8e16f6e7ca282ecaf7': 672,\n",
       "             '954469357b2434a20c76e940eca93185141b7f9b': 307,\n",
       "             '9560966fa5a7d4785a96b542a4b8a4ce1de4258e': 199,\n",
       "             '956dc1095d8f22575d3936191ce20b789b0ffc4d': 172,\n",
       "             '95926d03f275f4a3f04f068c2015e101a93a9292': 27,\n",
       "             '96f7b4f800cafef33eae71a6bc44f7139f63cd7a': 265,\n",
       "             '972cce803aa7beceaa7d0039e4c7c0ff097e4d55': 516,\n",
       "             '974a05be3d2385f40af4e6e610be59544657085e': 326,\n",
       "             '9784566a61c79b18b5d72584f3cc95ea134d14de': 183,\n",
       "             '9785d2098d36ae5d5859b4ef2261dbacaeeb6539': 117,\n",
       "             '97dd000ec4ace34cb5b3d3a47226b8c905bbe0cd': 297,\n",
       "             '97e2a28f577accc9efa329a9f78f151994f917b4': 455,\n",
       "             '991d7734c0de7ba034893145288e55dfa84caea9': 241,\n",
       "             '99259b34141119e5577009ae478cb9bf3f47f34d': 311,\n",
       "             '998e2858f6ffb758e298ad2223da4b7a65e676e3': 191,\n",
       "             '99ac3d883681e21ea68071019dba828ce76fe94d': 313,\n",
       "             '99dedd05d478e3aa54b199f4432fcb9907456b34': 498,\n",
       "             '99f86869c18bbd4a181e7d61c413d420323a5bf0': 433,\n",
       "             '9a251b8b6d4bee56dc5c57495cbc6f92c63a2f38': 686,\n",
       "             '9a285ec67a19e65bc86ff3a8b6b23463e579be3a': 1024,\n",
       "             '9a36a656c9397ee212bc70cb45e1eaef23bd1754': 439,\n",
       "             '9acce6b22c8ae6adbd9e0933fb0a374b149e8e88': 83,\n",
       "             '9af7bb657715f4b8bb63588fc8c8a3ec46cbdb6e': 166,\n",
       "             '9b06094a34c6c421b86df33c879b8980d1038cd8': 494,\n",
       "             '9b3ef1f58196e9119ae96e7ce33a1a5df641660f': 56,\n",
       "             '9b6067c2ab340f262024a1b2d6a3b80da95b2984': 387,\n",
       "             '9bcc96635a503c00eb083fed98269cf4580c5493': 102,\n",
       "             '9bd994a555e00a952696e113880ab37bfd50d2d1': 452,\n",
       "             '9bf0c40652e96b5178b552d2b296ec69b75a0b26': 389,\n",
       "             '9c2dfee26bbdd4fb19e9800244bea6e7181caeae': 563,\n",
       "             '9c2f4ed1abe5902331b5ed313b3bf8fedd009ead': 102,\n",
       "             '9c6ebf1d5ba38bcb577149b22e19448f655f6252': 852,\n",
       "             '9c859962257112ad523f1d3c121d35191daa6d2b': 703,\n",
       "             '9cc487a62c121c4d7d0e2d208c69f1908c347b77': 139,\n",
       "             '9cc55f495399d3f4ecb309c9eab9ce17250135c5': 269,\n",
       "             '9cdc5894219273434594b3cad7a4fe9b50df76eb': 790,\n",
       "             '9d17a429365653228049e8fe3d5968d4cd5dc6fe': 28,\n",
       "             '9d5c5b028adbf0815f08fdf61947fce997180b7c': 492,\n",
       "             '9de2c0225aa3a5bfdbc2e14ee688a9f3fc7d2d5a': 175,\n",
       "             '9e0a50a7dd689f541800fadcf0ab13d822b6b51c': 296,\n",
       "             '9e897fb0a5a4331319bb0f46a153800f804e305d': 141,\n",
       "             '9ed27a71127572f3c64af6b88b10a1631ca5ffad': 272,\n",
       "             '9f47e73fa4afd61e44c715d6415891a801459441': 414,\n",
       "             '9fd55256eb075d3d8506e67a54734e4f0d054e6c': 580,\n",
       "             'a0169cbcc939f1ef5fded0e109f71525936498cc': 459,\n",
       "             'a0513c57fc963efefea9ce3aad2ddeb92dd12ea7': 150,\n",
       "             'a05e548059abb1f77cad6cb9c3c0c48e0616f551': 81,\n",
       "             'a09d7a1cf61f8014900ce691c24d2c67b9f36ae3': 259,\n",
       "             'a0cce68e115910e1ad80fd1502bab746c74835f5': 188,\n",
       "             'a1253a9bf5a923de200687cf9c830e4ff045e26e': 194,\n",
       "             'a138ff8eca49aed0b7de923d7d63ad04cb246079': 132,\n",
       "             'a15075a926c1998d91940f118342ba8356efc7d4': 512,\n",
       "             'a153d22612598da8b42d19062e857c38629ee2bd': 111,\n",
       "             'a18aa09c5b8a1c03d03cdf6d8eb11c2bf5b907cd': 807,\n",
       "             'a2465c96340faf54e15445e66afc480a1760d01c': 205,\n",
       "             'a263000355e6a46de29ec637820771ac7620369f': 60,\n",
       "             'a2679496cd0af9779a92a13ff7c6af5c81ea8c7b': 3985,\n",
       "             'a2758cfd225f99b0494d98b3e7c65920345f95c8': 125,\n",
       "             'a3070ea64e61f871d41f27891f11f2753096eb3c': 193,\n",
       "             'a35cd4647f5eaf7fe9c79adfe8d9ec45b8bf3bd3': 531,\n",
       "             'a3a9329463c55f63876f84b0c47b4f90ca9db7bc': 20,\n",
       "             'a403e8052c47447959193e549dc6b609e6724466': 212,\n",
       "             'a41d3edbc2798b6800fe15845a979150eb244b85': 956,\n",
       "             'a4493d7bb8c07dc19e4208c8ed6925ec40300d36': 245,\n",
       "             'a4a068221b97aad518af038628daf1180e30113a': 577,\n",
       "             'a4ccc36714975978b545e35db83584fa9f7fa6c6': 187,\n",
       "             'a58e782566654163015fbeb4f079be0df18d680f': 334,\n",
       "             'a61d7a44a1879cb7229978bdc82a1cd830a30249': 15,\n",
       "             'a66e4977a166848f6ddafdb41c8ff010cab245ac': 1426,\n",
       "             'a75e441ecf8a9ca7014886bcd766cf693113afe1': 987,\n",
       "             'a7d2074d50f5feb6c653d73a2a07e47cd29b1b78': 337,\n",
       "             'a820826cfe28ac3da72cf5dbfd7a36633837a03a': 354,\n",
       "             'a8f2a047d194d46d1631b8138529de1febfcbbd5': 410,\n",
       "             'aabbd8b9388076451e70846a86cd4c8cb426873f': 16,\n",
       "             'ab792cde4fb868b3cf232791f173f7fd5e2ee83d': 411,\n",
       "             'ab8fcf84d35479e7a2c88416040e67a78217fbda': 638,\n",
       "             'ab9a997a846341347a3b7a5ba16a049e8e7d2f44': 1000,\n",
       "             'aba3117aae6344fb8d28c711b87b2aa3f1c4be75': 913,\n",
       "             'abaf265b7dc7d19732cde4e55e04a1ae65514e03': 259,\n",
       "             'ac4f4bf7db2d60ee8fdb4c382d7cf82ee58a14d4': 1582,\n",
       "             'acedfad21e1fd702aacda8111551f00b1f6f378e': 108,\n",
       "             'ad83013cbd32a74b6248a9304104edc14a2454c4': 250,\n",
       "             'ae30f0628af54f394bc94e29c934913d1ef7cff6': 234,\n",
       "             'ae552344f08d59c11b0a0b217f66b17ba9b37ba9': 338,\n",
       "             'aebdf0f0f916d0a4c69bf9521c2edc354494112d': 790,\n",
       "             'aec9f74039a6d861551c5e4e0a799a2ec4196c81': 381,\n",
       "             'af20e9d2df320612f53912d37dbd5c739e8d4710': 367,\n",
       "             'af3ee32357049dd96231238bd1b019e8142ee6aa': 12,\n",
       "             'aff2b00aeba4a389d22c474dc33645e0a6dfd56e': 171,\n",
       "             'b048f21afd5e7467f187bf9f9d413e97c32313a9': 276,\n",
       "             'b055cc3ae8159fe4bc656dc5631cc6659fc5cf72': 27,\n",
       "             'b0a3d755fe4a6549e241676b0a388e9410749c05': 1076,\n",
       "             'b1054cf00f4b3d2b7fc1548b19e423a50639c22f': 1,\n",
       "             'b1778b357f2e85d96008cd215c89fb15eb27a640': 340,\n",
       "             'b182ae1f9af1ec3b6a0165a4bc9b45affa0f4180': 224,\n",
       "             'b21e1b6b14b7b3b8b8e683e82ede0e59ad64e9f7': 1903,\n",
       "             'b30f2130643425464b7aa1ef13cf3a9a3deec4a7': 8,\n",
       "             'b33890c07bdc7497718af93cd00077e644440b49': 357,\n",
       "             'b3c3f21a853a53c9de20dd1cd10391eb9a1e2db8': 500,\n",
       "             'b3dd0cfd6801e5af3a1a42acd9055f97c0112ad8': 1540,\n",
       "             'b4357696b37950c23ce4e87f7e8620071f65fc44': 409,\n",
       "             'b4565d87a53751d2370be4247718b699f7fff028': 63,\n",
       "             'b460df238d3e65ad400a2b6aa546ec883e1f2e1c': 1084,\n",
       "             'b48bce8e10734afe708b84dfa8f4492b03d60613': 7,\n",
       "             'b493eda768d25cfb48dec2567b0826cdb9f6eef4': 1730,\n",
       "             'b4c94d72b15d3c311c10045a58b31f95d9d12785': 110,\n",
       "             'b4cfdefb94d1df6714c9962923edb73470e6fa7b': 252,\n",
       "             'b5186694bb2406962edb3a8042b535449627fa37': 357,\n",
       "             'b591619dbc25ef7b4451456dd1b01b56033e1d8d': 667,\n",
       "             'b5cd4cc3732cb06c6cd381e950b9378b0e9c55db': 291,\n",
       "             'b609782bb33d01178d485e147022c1c7e5c30550': 947,\n",
       "             'b6294fa6a76a84789d038b7133ddc308391bacc6': 871,\n",
       "             'b6d8573109462bad5457196b31564c4df4235741': 673,\n",
       "             'b7032f457c624e23113c39b2f9c444a961c3fdf8': 550,\n",
       "             'b7948bd0aab3932852dce33f89604a85736a449a': 145,\n",
       "             'b7b27457acf41d121f029edf004247acad3f4b70': 304,\n",
       "             'b7c24f770be6b802805ac0e2106624a517643c17': 2040,\n",
       "             'b80501c77662b97dcf29488faa7ff154a40c8ce6': 154,\n",
       "             'b82d692dde839cfe9fd6d309bb8c46d50089cc16': 214,\n",
       "             'b83e4bed18b28ba0beb5a0ff5079b0eb397ae509': 577,\n",
       "             'b85e44249a1d26a378c0757442452525ecfa1abf': 286,\n",
       "             'b85e70839fc5b7fd6efe8e152c9e20021157bea3': 608,\n",
       "             'b8eb72ac5c082e6953254f628978468dc8fa0c94': 102,\n",
       "             'ba43e2ef9ea08ae36dbb127d9af34b61536219c9': 274,\n",
       "             'bb0c93f971ee41a7bdfedcd9aad701bfadfca5c8': 1494,\n",
       "             'bb0d8c40d8932c5960e8e4443aa391adb9dfe9da': 2,\n",
       "             'bb279e21a433803eb4a3dc5d31d2fed80d06fc98': 394,\n",
       "             'bb779da8fa95749fe29033a790f714868497be46': 86,\n",
       "             'bbb4be7912be85f7d1761e4ac80898e67d6488ee': 250,\n",
       "             'bc3777585de3e0786e06328c118de9eb47470726': 943,\n",
       "             'bc81c5b7464294e6790a8346c8717da4675fbf70': 231,\n",
       "             'bcea1e1cb0b1d68ca2ab91ddf81ff6300ed6051d': 262,\n",
       "             'bd15283f768266070f7e9982504db167a494510c': 55,\n",
       "             'bd158e566db8d5879124cf177d2ee91e80362075': 395,\n",
       "             'bd278ae17d500d28e5601ae0a6a86c02cae2ea19': 291,\n",
       "             'bd3478df2f64daf2e38b0550c988157b2c118481': 330,\n",
       "             'bd82eefb8f1ddc894b48ee2baca28c89ff70710d': 276,\n",
       "             'bdf5314983631954f528737d3babb3f68430574c': 314,\n",
       "             'bdfca47d03157d26f1404075172128a6f8a3d39e': 506,\n",
       "             'bed4337ed5ec3f0e6bc195755847e5fcef35c5c3': 196,\n",
       "             'bedad07238f60df86cb77b2d4ef1441c8f0b3a3b': 281,\n",
       "             'bf181aecbcc49ea1656a9d81b8fd681dae094642': 919,\n",
       "             'bf82fdc9210bdaa712a5e310a35fe9784d5700e4': 343,\n",
       "             'c012ec364329bb08cbe3e62fe76db31f8c5d8ec3': 1314,\n",
       "             'c0dc381d5ddf02f5182179c164ca65db6c8f572b': 682,\n",
       "             'c0eef7fea03eebfe01fb79e9144d13691ef7acd4': 555,\n",
       "             'c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d': 41,\n",
       "             'c11dea7d1f4d227b98c5f2a79561bf76884fcf10': 58,\n",
       "             'c1208e7619f17c78d5286f95ca9928408e58f4ed': 150,\n",
       "             'c1255748c06ee3f6440c51c439446886c7807095': 1291,\n",
       "             'c15570ec9ccc9f4093fc51dba952de0558c74ae7': 491,\n",
       "             'c1912062175dc4b3ea5a3a0cdb963c704bb9c881': 1585,\n",
       "             'c20bccecc9d79ae108226e36cec975cd3c1227f7': 114,\n",
       "             'c2d78d260f5bddc3fa2db228bb72ccae6ff7a8e1': 1025,\n",
       "             'c2dbf6f4c32dc36af4d6fadb16cd8b79c64a6aa8': 824,\n",
       "             'c2fd42c798c8a62d997896641e4274b17cc252f0': 363,\n",
       "             'c337bc0346e01c8b0105691b8f970b9a6960a572': 716,\n",
       "             'c3eee61e081ea89785c4fa4a4a0f29f9f5eb5829': 187,\n",
       "             'c405c586f6d7aadbbadfcba5393b543fd99372ff': 522,\n",
       "             'c47e1a887a1b437dc9acd19af5592c414bb6ca86': 224,\n",
       "             'c48985a0208be8ee31f09edf031fb3c2be0790c7': 399,\n",
       "             'c4ba936dabbf1a09945bc9073126384778075229': 630,\n",
       "             'c4cb30cad8e1599e66d9ccef7fae3b6ba83bb5ec': 845,\n",
       "             'c4e39863d31ec44b0d6099851e65fdc0c4a0f9d0': 613,\n",
       "             'c5d0030d32982330235e80d3395e412c38c552d1': 603,\n",
       "             'c60ae0b37165937469a3be7a140743d9acb25040': 143,\n",
       "             'c6407c06bb11a4fc74b1dbbd4b4474d89581f08b': 763,\n",
       "             'c7417a59a6d67ef869bf970671b5246c4e3e16d6': 1519,\n",
       "             'c802248ec0f960549720bb9f409fec7264b8b2f9': 563,\n",
       "             'c8966cdc06b761c96722d810888020e0fc120cdd': 251,\n",
       "             'c9ccbdf63666eb4b570bb9103f371346e2c3b378': 100,\n",
       "             'c9f6fe7decdc7ca98d226717b4e3d660253c224f': 323,\n",
       "             'ca658ff2092285a3fd7f1ccbc54e10211e184f66': 606,\n",
       "             'ca78731f0ab4d81724b76a3b2258ca394eddd31e': 48,\n",
       "             'cbbe74dbde73f3b0005f9f1422d9f1e62cb54115': 84,\n",
       "             'cbc7bddbe3b2f59fdbe031b3c8d0db4175d361e6': 107,\n",
       "             'cc60505d5994ddcd6103a2bf1faf5f774b7909d3': 121,\n",
       "             'ccf165cdbcfb7f555e3a8dbcba4a10a86c92ab97': 453,\n",
       "             'cd412da0241d661a601ed7b0b52285a097c19120': 32,\n",
       "             'cd58f3d02bfa9e5df95971cde778593012241236': 471,\n",
       "             'cdb0890015b23c5180dc6d503d6f1b7b8b545aef': 515,\n",
       "             'ceac6b2713499c25cf217ec915063de66e26a586': 398,\n",
       "             'ceb2cb3d77d5ff423d93b5b52c74df5b133cee95': 468,\n",
       "             'cec2900f576811343ea915dc12c0fdd3076185b0': 341,\n",
       "             'cf816f2ddcc462856d7df4b0db9e1f17f91e93b5': 41,\n",
       "             'cfd5725824fffc294548dbd8a237edc751e354dc': 242,\n",
       "             'd04eed168e8e31d9d05cfca98cf08a3abf7bd9f4': 487,\n",
       "             'd0a2c5ac5ce1bc3573224d910fe3adfb85d4ee3f': 472,\n",
       "             'd13609d62db6df876d3cc388225478618bb7b912': 95,\n",
       "             'd19e8c59d207bf3e3c7ca0248a1fa684c00d006b': 354,\n",
       "             'd1c230d4464ed57479152c9590c4f2488b3f2e3e': 243,\n",
       "             'd2396f84238693721349e3dfb9e109bb67b93fca': 7,\n",
       "             'd2423c01882062ac950909b0ffe96b30e54ab063': 2036,\n",
       "             'd28af1bcf1166c19f8c72b5340190c835baa329f': 295,\n",
       "             'd2adc192d87fa15e241a0401e4c5fa91d44d0b4b': 71,\n",
       "             'd331a8bf7d0ca9cb37e375496e6075603f6fb44a': 965,\n",
       "             'd36ab75927461e694d0e03174c5b291557e73f4a': 156,\n",
       "             'd375c4189987e1029e61b35aff6d34d568e6705c': 195,\n",
       "             'd3f104f65ae11dfe9a116f94d9b28361b36c803d': 129,\n",
       "             'd446e7c921a102071026003e6baf3175afc535e8': 181,\n",
       "             'd4a037cfe94cd2fc8b0e8c6109fe5a986a9de9a6': 406,\n",
       "             'd4e2a1187bd88b3d1799371325e0b3565cffa423': 78,\n",
       "             'd5a0a13d3d1898d80ef470916a05794f664c14df': 190,\n",
       "             'd5d1fc74f29ef42eefc2acf4c8c59da2994a0a16': 229,\n",
       "             'd608097fba47ad5d96104d40bbf275d2b6e069f7': 56,\n",
       "             'd66c5b1be56e90603867af719662c9ac2efeb9f0': 635,\n",
       "             'd6aa929de7dc0b63f1f42bd0aef31906070d03bf': 268,\n",
       "             'd71adb94c30db90d20b08bde62acb7ef1966083d': 500,\n",
       "             'd7d2d888ae04d16e994d6964214a1de81392ee04': 189,\n",
       "             'd8aace9308e530e0f1ef2a85258b62f8245be423': 419,\n",
       "             'd8e6fa08d73821f305b9a3af1cf1e0a704473d82': 3661,\n",
       "             'd8fed2e63f7d78824128282abc2e9a0a3fcfdfe0': 218,\n",
       "             'd90c31b67dba80b2aa26dc0a6f595a16ea838b24': 132,\n",
       "             'd91ca966f809ef4a77999b031c90fcd5253fecc0': 314,\n",
       "             'd94c488f5d1d5cf2f15871aaa5f95dc9f319ed80': 196,\n",
       "             'd964fc033291078031d117ed10adfb615948256d': 164,\n",
       "             'd973927bf4dc68e84e595f206f899631e74f5baa': 846,\n",
       "             'd9e5124935aebeb6b9b169df2d28e1fc658d3566': 214,\n",
       "             'da3890400751de76f0f05ef0e93aa1cd898e7dbc': 592,\n",
       "             'da681f423e8574d2581534fd138eae264dea0f5c': 87,\n",
       "             'dae08b6f200be684168b34d6aae3d518f4c5d142': 527,\n",
       "             'dae0bbb6e964a8f5495fa6edfb7321437b28b5a1': 678,\n",
       "             'db6a78c78c9239aba33861dae7611a6893fb27d5': 1229,\n",
       "             'dbb235f944fe78ef8198950e64e4bbc2bdbef172': 160,\n",
       "             'dc02d3c4fb534ca1406f720c70678e5858a5ca0a': 971,\n",
       "             'dc3c9b5c1dc31b96cc9f9303a6d996e0dd47731e': 118,\n",
       "             'dc543ff951c23be4e9e8fdf6f39a23cef85f3b5e': 303,\n",
       "             'dc61155e20289dcd089ac40181cb88f042404602': 208,\n",
       "             'dd0a2cc711c7ae2deb57c0089ded533db473d5b1': 55,\n",
       "             'dd29009e6148c8c21544c27e7c074b4601ba54e5': 70,\n",
       "             'dd3696048c81b1aff836a606cda7e14be5bb92a6': 311,\n",
       "             'ddf7fe59709fb2341fa93c34910ae2b17a9a5930': 713,\n",
       "             'de1f7a1048b9c7ff83118bd4679b33c3d2d29a47': 718,\n",
       "             'de27b74444dae039f76e421362c6a914da9f8b41': 3,\n",
       "             'de32503addf63b2ca79e523770bc9c790c3b4d63': 424,\n",
       "             'dea83a96cb70f382174ebd606774aa1f8d86749a': 42,\n",
       "             'debd74c1999b195eeddf09bc0af751c93a52c205': 610,\n",
       "             'df0a4e8d30f7a8f2fcb7c2f1e148f7c3938acada': 418,\n",
       "             'df29d6bfb3a8055621ebf87884405d475b325d91': 473,\n",
       "             'dfd62f3ee786c4579b262421b33b8110d931733f': 591,\n",
       "             'e0152edeec1154b620b083fbb095f1f0f4de5e2e': 458,\n",
       "             'e0314b2a3e48610bedb47f4663916170fb6188aa': 41,\n",
       "             'e04a9e4861256079476c25d655d97c1c5603b3cd': 419,\n",
       "             'e0892dd1ac13bb10434b026372e7a0d2fae62444': 296,\n",
       "             'e0f516b4485a9c74872ed1481661910ffd4f5352': 229,\n",
       "             'e15392fc2c28262b88b94f44e9313bd5e1b4e181': 416,\n",
       "             'e15e7c10cfd3ffc6e2b2673dcd0981b83c1ff4ae': 91,\n",
       "             'e188fe2b5e466d90dd3749be8556fc003343ddfd': 509,\n",
       "             'e1fb00119a9c156392a481c3cab6c732c9027cbe': 226,\n",
       "             'e2365d08cab3e0dc773d7050875d506260ecb812': 78,\n",
       "             'e32ad2237aac1ac4971b6585686fc70ba6b5ffbf': 247,\n",
       "             'e33daf7524a179b9083abdf9937c26fd1ae6fd94': 540,\n",
       "             'e34584c41e515fd817644d6203c27471a5ad0ae2': 130,\n",
       "             'e3d45fa4071c85b044191cabf0284e74c744a037': 304,\n",
       "             'e3dc1a577d1432b6406f3bed18d92fd6830ed69e': 6,\n",
       "             'e3e8103d0751e29693f9b03a58efa5c21acf2115': 100,\n",
       "             'e3fce0e4f316567685119c9af7d04d67c84f0a46': 293,\n",
       "             'e46932327dfffa6ec69dbadbe9dd883a3a383673': 480,\n",
       "             'e504626e4d38404e3928bda4b0f266cbd38c42d8': 50,\n",
       "             'e58e9da7ba717f1bc6079626d5513530dd8f9b97': 935,\n",
       "             'e5b1a35349132afe4f96dd6b39cdc4d94031eb1b': 316,\n",
       "             'e5b4f068ec1446a74564b4b8b8d13dcea7d27840': 426,\n",
       "             'e6558266b59a42a328ae3faac89701cfedabb558': 119,\n",
       "             'e6b18cffa2afad9245b7d9eb08390efeebef1f3b': 162,\n",
       "             'e6e0f68e948d7bcbf2ed9c4506a40a139a5e7bc7': 681,\n",
       "             'e740128a5500e4935a4ded8c736599f1e14b8406': 273,\n",
       "             'e7775d30ad499fa204257d1246a7f87a6bfcc80f': 789,\n",
       "             'e8184db22c453007c34ba8ab7e2a4cda8ca7969b': 83,\n",
       "             'e82b3380f770c78f8f067f464941057c798eaca2': 365,\n",
       "             'e851e806941435c6d5748bd64c1c55e5c0551ab1': 143,\n",
       "             'e8b1bfe5ab922211ba3cdb2e98d9c51f718974ed': 277,\n",
       "             'e8f6a8d06b0096737dec1a9f44c3d48cd9e5e4b8': 231,\n",
       "             'e9073fcbe8aa26ed90752c7d620a611fbc3f0b9c': 335,\n",
       "             'e96d6f48f18ca3fbf371bcc32cc9f005ee3b3169': 49,\n",
       "             'e9db66c0ab2a9cd538ffe6bdb677245a8c1c7d27': 181,\n",
       "             'ea01cb794fb07af9cb3a29da0bd31126735be410': 146,\n",
       "             'eaa2b3c9e086a662ab15e10ca6211a3207f40a50': 792,\n",
       "             'eb69f5a5465388b63fe66a410f7c58e17fb7bade': 333,\n",
       "             'eb75703cc9f9a33c4b1d2f7b3abf9a6be4c732aa': 45,\n",
       "             'ec06a94669597cdc8d1360c6a906aa95333326e8': 483,\n",
       "             'ec65de93b89e3301f3479bdaa0a98c0afbd4ffef': 138,\n",
       "             'ec6dfcf19485cb011e0b22637075037aae34cf26': 59,\n",
       "             'ed3e56f28c9b1f6dd18270cf3c29f764ae8e4712': 197,\n",
       "             'edbeebbe98aeceb8d38b1de33ac1b1e201041284': 180,\n",
       "             'edbeebcabe2c23a3e34294a98ea6cb6d63028c83': 210,\n",
       "             'ee0a82caa004000e80a192be7c455a53b8256f20': 202,\n",
       "             'ee30810179c611d32705fe0b71333dcb8703b30a': 190,\n",
       "             'ee7aa84c164038c963cfd02a7e52a5598aa470c3': 78,\n",
       "             'eead778628d156cb05b8712f6b1493ee4dba3c66': 311,\n",
       "             'ef9fb1992db82a4c6321bc32ac5988083ca83864': 313,\n",
       "             'f02ef1e670319151d2d27f4215fb16a973f7de2f': 386,\n",
       "             'f0b5c784daaa3c7d50acbb3723c7dd649db2b231': 9,\n",
       "             'f0da5f1500f48e04e8162df28ebbeb1d5eca3cc9': 166,\n",
       "             'f1333b616d0fcde8dd0d407c504a5f91fef31396': 194,\n",
       "             'f2a03543373cfed80f076f3337360630f084ad30': 847,\n",
       "             'f36597bc11ce99d965f4db2e065cf9d648bda39e': 8,\n",
       "             'f3825861e5575cf4206f883630754fa30c80721e': 84,\n",
       "             'f629b337d01f254e0d685ccc66ec2fd5ddba78d9': 258,\n",
       "             'f66c8ecc6e2ac67c92e10cd01be6a6f335e2526e': 449,\n",
       "             'f6ae5e682750e815c1709ca99138d03b039839d6': 1508,\n",
       "             'f6d78516f331c684ee611e07effcb796e94ae456': 666,\n",
       "             'f799c4ea9030eea12c078db1c1fcd5fa956e786b': 561,\n",
       "             'f8181f9b3d85fa4ac04c66bc9f84f0ad2a18a777': 787,\n",
       "             'f84fb3d29bb05bb9dec96684215c763ccbbc67a9': 572,\n",
       "             'f8544ba8ff908f44d61f5d9d17c213423c1fc782': 15,\n",
       "             'f986a1b01b2a75109baa39d637537b5124c111ab': 48,\n",
       "             'f99a25251dfd3c44b629c3658bf6c0d0a7a3d0ce': 709,\n",
       "             'f9cf7849592621b46a793e0f283de8ab48b3d5f8': 65,\n",
       "             'f9edc8907be695518817082a224aa43beca7d994': 302,\n",
       "             'fa5d9eddc010bc3fc71f8a42db15e5dd4f1c18a3': 832,\n",
       "             'faf0beb5d7ff9d39244b0713de08304c3691f71b': 401,\n",
       "             'fb644c3f2a83114325dc67b97df0bce60b5ac9a1': 641,\n",
       "             'fba8ff1f9dd32aa35f3e13960a008fec773e2903': 350,\n",
       "             'fbd1b7d1bf19158773820cb45639362347979926': 529,\n",
       "             'fc05f377863a77d7784b02de2cc06cdecb85968b': 239,\n",
       "             'fc77d71ecc8a4c7f4a0402fbe9118973124391fe': 387,\n",
       "             'fcbc6bdcec1f293d1d03bbf3c64f613e59acbfe0': 726,\n",
       "             'fd1ebc6caa7ad07c84677ba6bada683077bf0f15': 304,\n",
       "             'fe2d77de7e57f3b3eedcf473545110b13ca03426': 919,\n",
       "             'fe53f4bc06e09b02015312e1d0ea48b208cd490e': 278,\n",
       "             'fe67eae6791418a5a85125145609f518f01efe48': 393,\n",
       "             'fe8b98246d279f71f7cb0d493cdedce2bbc30aae': 378,\n",
       "             'fe9a05c03c29da973743a83b80d1660748077432': 109,\n",
       "             'fef771ab021c200187a419f5e55311390f850a50': 186,\n",
       "             'ff124a0cd09e26b78b2b7d3a1de83512ba9978c8': 383,\n",
       "             'ff7429bd2788349b026cf8f8a7a4b3f3971a310a': 303,\n",
       "             'ffa96cd6cc641b38a946e8444d261435d615b2dc': 87,\n",
       "             'ffe2ec5b72cddb8537ad7f0ac191624f8ae2c8dc': 16,\n",
       "             'ffe5ad43c24d81878621185e164043a6e49b2fe4': 422})"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "totalCount_For_EveryUser"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 整理出用户-歌曲关于打分的关系矩阵，用播放比例来打分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:21.042296Z",
     "start_time": "2018-11-15T02:01:21.022294Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#添加多一列显示总的播放次数\n",
    "tripletDatasetSub[\"total_play_count\"] = None"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:43.636588Z",
     "start_time": "2018-11-15T02:01:21.050296Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "i=:0 \n",
      "i=:100 \n",
      "i=:200 \n",
      "i=:300 \n",
      "i=:400 \n",
      "i=:500 \n",
      "i=:600 \n",
      "i=:700 \n",
      "i=:800 \n",
      "i=:900 \n",
      "i=:1000 \n",
      "i=:1100 \n",
      "i=:1200 \n",
      "i=:1300 \n",
      "i=:1400 \n",
      "i=:1500 \n",
      "i=:1600 \n",
      "i=:1700 \n",
      "i=:1800 \n",
      "i=:1900 \n",
      "i=:2000 \n",
      "i=:2100 \n",
      "i=:2200 \n",
      "i=:2300 \n",
      "i=:2400 \n",
      "i=:2500 \n",
      "i=:2600 \n",
      "i=:2700 \n",
      "i=:2800 \n",
      "i=:2900 \n",
      "i=:3000 \n",
      "i=:3100 \n",
      "i=:3200 \n",
      "i=:3300 \n",
      "i=:3400 \n",
      "i=:3500 \n",
      "i=:3600 \n",
      "i=:3700 \n",
      "i=:3800 \n",
      "i=:3900 \n",
      "i=:4000 \n",
      "i=:4100 \n",
      "i=:4200 \n",
      "i=:4300 \n",
      "i=:4400 \n",
      "i=:4500 \n",
      "i=:4600 \n",
      "i=:4700 \n",
      "i=:4800 \n",
      "i=:4900 \n",
      "i=:5000 \n",
      "i=:5100 \n",
      "i=:5200 \n",
      "i=:5300 \n",
      "i=:5400 \n",
      "i=:5500 \n",
      "i=:5600 \n",
      "i=:5700 \n",
      "i=:5800 \n",
      "i=:5900 \n",
      "i=:6000 \n",
      "i=:6100 \n",
      "i=:6200 \n",
      "i=:6300 \n",
      "i=:6400 \n",
      "i=:6500 \n",
      "i=:6600 \n",
      "i=:6700 \n",
      "i=:6800 \n",
      "i=:6900 \n",
      "i=:7000 \n",
      "i=:7100 \n",
      "i=:7200 \n",
      "i=:7300 \n",
      "i=:7400 \n",
      "i=:7500 \n",
      "i=:7600 \n",
      "i=:7700 \n",
      "i=:7800 \n",
      "i=:7900 \n",
      "i=:8000 \n",
      "i=:8100 \n",
      "i=:8200 \n",
      "i=:8300 \n",
      "i=:8400 \n",
      "i=:8500 \n",
      "i=:8600 \n",
      "i=:8700 \n",
      "i=:8800 \n",
      "i=:8900 \n",
      "i=:9000 \n",
      "i=:9100 \n",
      "i=:9200 \n",
      "i=:9300 \n",
      "i=:9400 \n",
      "i=:9500 \n",
      "i=:9600 \n",
      "i=:9700 \n",
      "i=:9800 \n",
      "i=:9900 \n",
      "i=:10000 \n",
      "i=:10100 \n",
      "i=:10200 \n",
      "i=:10300 \n",
      "i=:10400 \n",
      "i=:10500 \n",
      "i=:10600 \n",
      "i=:10700 \n",
      "i=:10800 \n",
      "i=:10900 \n",
      "i=:11000 \n",
      "i=:11100 \n",
      "i=:11200 \n",
      "i=:11300 \n",
      "i=:11400 \n",
      "i=:11500 \n",
      "i=:11600 \n",
      "i=:11700 \n",
      "i=:11800 \n",
      "i=:11900 \n",
      "i=:12000 \n",
      "i=:12100 \n",
      "i=:12200 \n",
      "i=:12300 \n",
      "i=:12400 \n",
      "i=:12500 \n",
      "i=:12600 \n",
      "i=:12700 \n",
      "i=:12800 \n",
      "i=:12900 \n",
      "i=:13000 \n",
      "i=:13100 \n",
      "i=:13200 \n",
      "i=:13300 \n",
      "i=:13400 \n",
      "i=:13500 \n",
      "i=:13600 \n",
      "i=:13700 \n",
      "i=:13800 \n",
      "i=:13900 \n",
      "i=:14000 \n",
      "i=:14100 \n",
      "i=:14200 \n",
      "i=:14300 \n",
      "i=:14400 \n",
      "i=:14500 \n",
      "i=:14600 \n",
      "i=:14700 \n",
      "i=:14800 \n",
      "i=:14900 \n",
      "i=:15000 \n",
      "i=:15100 \n",
      "i=:15200 \n",
      "i=:15300 \n",
      "i=:15400 \n",
      "i=:15500 \n",
      "i=:15600 \n",
      "i=:15700 \n",
      "i=:15800 \n",
      "i=:15900 \n",
      "i=:16000 \n",
      "i=:16100 \n",
      "i=:16200 \n",
      "i=:16300 \n",
      "i=:16400 \n",
      "i=:16500 \n",
      "i=:16600 \n",
      "i=:16700 \n",
      "i=:16800 \n",
      "i=:16900 \n",
      "i=:17000 \n",
      "i=:17100 \n",
      "i=:17200 \n",
      "i=:17300 \n",
      "i=:17400 \n",
      "i=:17500 \n",
      "i=:17600 \n",
      "i=:17700 \n",
      "i=:17800 \n",
      "i=:17900 \n",
      "i=:18000 \n",
      "i=:18100 \n",
      "i=:18200 \n",
      "i=:18300 \n",
      "i=:18400 \n",
      "i=:18500 \n",
      "i=:18600 \n",
      "i=:18700 \n",
      "i=:18800 \n",
      "i=:18900 \n",
      "i=:19000 \n",
      "i=:19100 \n",
      "i=:19200 \n",
      "i=:19300 \n",
      "i=:19400 \n",
      "i=:19500 \n",
      "i=:19600 \n",
      "i=:19700 \n",
      "i=:19800 \n",
      "i=:19900 \n",
      "i=:20000 \n",
      "i=:20100 \n",
      "i=:20200 \n",
      "i=:20300 \n",
      "i=:20400 \n",
      "i=:20500 \n",
      "i=:20600 \n",
      "i=:20700 \n",
      "i=:20800 \n",
      "i=:20900 \n",
      "i=:21000 \n",
      "i=:21100 \n",
      "i=:21200 \n",
      "i=:21300 \n",
      "i=:21400 \n",
      "i=:21500 \n",
      "i=:21600 \n",
      "i=:21700 \n",
      "i=:21800 \n",
      "i=:21900 \n",
      "i=:22000 \n",
      "i=:22100 \n",
      "i=:22200 \n",
      "i=:22300 \n",
      "i=:22400 \n",
      "i=:22500 \n",
      "i=:22600 \n",
      "i=:22700 \n",
      "i=:22800 \n",
      "i=:22900 \n",
      "i=:23000 \n",
      "i=:23100 \n",
      "i=:23200 \n",
      "i=:23300 \n",
      "i=:23400 \n",
      "i=:23500 \n",
      "i=:23600 \n",
      "i=:23700 \n",
      "i=:23800 \n",
      "i=:23900 \n",
      "i=:24000 \n",
      "i=:24100 \n",
      "i=:24200 \n",
      "i=:24300 \n",
      "i=:24400 \n",
      "i=:24500 \n",
      "i=:24600 \n",
      "i=:24700 \n",
      "i=:24800 \n",
      "i=:24900 \n",
      "i=:25000 \n",
      "i=:25100 \n",
      "i=:25200 \n",
      "i=:25300 \n",
      "i=:25400 \n",
      "i=:25500 \n",
      "i=:25600 \n",
      "i=:25700 \n",
      "i=:25800 \n",
      "i=:25900 \n",
      "i=:26000 \n",
      "i=:26100 \n",
      "i=:26200 \n",
      "i=:26300 \n",
      "i=:26400 \n",
      "i=:26500 \n",
      "i=:26600 \n",
      "i=:26700 \n",
      "i=:26800 \n",
      "i=:26900 \n",
      "i=:27000 \n",
      "i=:27100 \n",
      "i=:27200 \n",
      "i=:27300 \n",
      "i=:27400 \n",
      "i=:27500 \n",
      "i=:27600 \n",
      "i=:27700 \n",
      "i=:27800 \n",
      "i=:27900 \n",
      "i=:28000 \n",
      "i=:28100 \n",
      "i=:28200 \n",
      "i=:28300 \n",
      "i=:28400 \n",
      "i=:28500 \n",
      "i=:28600 \n",
      "i=:28700 \n",
      "i=:28800 \n",
      "i=:28900 \n",
      "i=:29000 \n",
      "i=:29100 \n",
      "i=:29200 \n",
      "i=:29300 \n",
      "i=:29400 \n",
      "i=:29500 \n",
      "i=:29600 \n",
      "i=:29700 \n",
      "i=:29800 \n",
      "i=:29900 \n",
      "i=:30000 \n",
      "i=:30100 \n",
      "i=:30200 \n",
      "i=:30300 \n",
      "i=:30400 \n",
      "i=:30500 \n",
      "i=:30600 \n",
      "i=:30700 \n",
      "i=:30800 \n",
      "i=:30900 \n",
      "i=:31000 \n",
      "i=:31100 \n",
      "i=:31200 \n",
      "i=:31300 \n",
      "i=:31400 \n",
      "i=:31500 \n",
      "i=:31600 \n",
      "i=:31700 \n",
      "i=:31800 \n",
      "i=:31900 \n",
      "i=:32000 \n",
      "i=:32100 \n",
      "i=:32200 \n",
      "i=:32300 \n",
      "i=:32400 \n",
      "i=:32500 \n",
      "i=:32600 \n",
      "i=:32700 \n",
      "i=:32800 \n",
      "i=:32900 \n",
      "i=:33000 \n",
      "i=:33100 \n",
      "i=:33200 \n",
      "i=:33300 \n",
      "i=:33400 \n",
      "i=:33500 \n",
      "i=:33600 \n",
      "i=:33700 \n",
      "i=:33800 \n",
      "i=:33900 \n",
      "i=:34000 \n",
      "i=:34100 \n",
      "i=:34200 \n",
      "i=:34300 \n",
      "i=:34400 \n",
      "i=:34500 \n",
      "i=:34600 \n",
      "i=:34700 \n",
      "i=:34800 \n",
      "i=:34900 \n",
      "i=:35000 \n",
      "i=:35100 \n",
      "i=:35200 \n",
      "i=:35300 \n",
      "i=:35400 \n",
      "i=:35500 \n",
      "i=:35600 \n",
      "i=:35700 \n",
      "i=:35800 \n",
      "i=:35900 \n",
      "i=:36000 \n",
      "i=:36100 \n",
      "i=:36200 \n",
      "i=:36300 \n",
      "i=:36400 \n",
      "i=:36500 \n",
      "i=:36600 \n",
      "i=:36700 \n",
      "i=:36800 \n",
      "i=:36900 \n",
      "i=:37000 \n",
      "i=:37100 \n",
      "i=:37200 \n",
      "i=:37300 \n",
      "i=:37400 \n",
      "i=:37500 \n"
     ]
    }
   ],
   "source": [
    "for i in range (totalLines):\n",
    "    if(i % 100 == 0):\n",
    "        print (\"i=:%d \" % (i))\n",
    "    tripletDatasetSub.iat[i,3] = totalCount_For_EveryUser[tripletDatasetSub.iloc[i][\"user\"]]#对应在表格里面填充对应的播放总数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:43.752595Z",
     "start_time": "2018-11-15T02:01:43.645588Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user</th>\n",
       "      <th>song</th>\n",
       "      <th>play_count</th>\n",
       "      <th>total_play_count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOCKSGZ12A58A7CA4B</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOCVTLJ12A6310F0FD</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SODLLYS12A8C13A96B</td>\n",
       "      <td>3</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOEGIYH12A6D4FC0E3</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOFRQTD12A81C233C0</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOHEMBB12A6701E907</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOHJOLH12A6310DFE5</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOIZLKI12A6D4F7B61</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOJGSIO12A8C141DBF</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKEYJQ12A6D4F6132</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKLRPJ12A8C13C3FE</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKNWRZ12A8C13BF62</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKXYUW12A8C140229</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLAUOW12A8C13A400</td>\n",
       "      <td>3</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLLDVS12AB0183835</td>\n",
       "      <td>6</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLOZRE12A8C133256</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLWRZI12A6D4FC4F0</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMDVSL12A6D4F7230</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMGIYR12AB0187973</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMNGMO12A6702187E</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMRYYN12A6310F0F3</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONDCOR12A8C13BA16</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONQBUB12A6D4F8ED0</td>\n",
       "      <td>3</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONYKOW12AB01849C9</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOALOT12A8C13ABD9</td>\n",
       "      <td>5</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOKGRB12A8C13CD66</td>\n",
       "      <td>4</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOSJIV12AF729E09E</td>\n",
       "      <td>5</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOZFCC12A58A7D783</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOPBXPQ12AB01887E2</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOPCTBB12AF72A1B64</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOWOMMY127F8096DF9</td>\n",
       "      <td>18</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXGIWN12A6310E0D8</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXMGFH12A6701FF31</td>\n",
       "      <td>7</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXNYUA12AB017B49B</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXNZUH12AB018393F</td>\n",
       "      <td>15</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXPFLM12A8AE48C50</td>\n",
       "      <td>19</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXQYSC12A6310E908</td>\n",
       "      <td>26</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXWYZP12AF72A42A6</td>\n",
       "      <td>20</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXZOMB12AB017DA15</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOYCXUA12A8C133713</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOYEVUY12A8C145F58</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOZDACG12AB01853BB</td>\n",
       "      <td>6</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOZIBZP12A6701C434</td>\n",
       "      <td>11</td>\n",
       "      <td>423</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SODCNJX12A6D4F93CB</td>\n",
       "      <td>11</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SORALYQ12A8151BA99</td>\n",
       "      <td>9</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOUVTSM12AC468F6A7</td>\n",
       "      <td>2</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>186</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOVRMZU12AB017FE90</td>\n",
       "      <td>3</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOWPASM12A8C142B88</td>\n",
       "      <td>3</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>188</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOWSXLZ12AB017BD9A</td>\n",
       "      <td>1</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>189</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOYAIPB12A8C143D84</td>\n",
       "      <td>12</td>\n",
       "      <td>41</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOAXGDH12A8C13F8A1</td>\n",
       "      <td>4</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOHFNKO12AB017C772</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOHJOLH12A6310DFE5</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOILFUU12AB017C75F</td>\n",
       "      <td>3</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>194</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOIMQAK12A67ADE98C</td>\n",
       "      <td>1</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOODSPH12AB01819C3</td>\n",
       "      <td>4</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOOWVNN12A8C140775</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOPAYPV12AB017DB0C</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOPCQRT12A8C13B15D</td>\n",
       "      <td>1</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOPKPSQ12A58A7A5E4</td>\n",
       "      <td>1</td>\n",
       "      <td>61</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 4 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                         user                song  play_count  \\\n",
       "0    4e11f45d732f4861772b2906f81a7d384552ad12  SOCKSGZ12A58A7CA4B           1   \n",
       "1    4e11f45d732f4861772b2906f81a7d384552ad12  SOCVTLJ12A6310F0FD           1   \n",
       "2    4e11f45d732f4861772b2906f81a7d384552ad12  SODLLYS12A8C13A96B           3   \n",
       "3    4e11f45d732f4861772b2906f81a7d384552ad12  SOEGIYH12A6D4FC0E3           1   \n",
       "4    4e11f45d732f4861772b2906f81a7d384552ad12  SOFRQTD12A81C233C0           2   \n",
       "5    4e11f45d732f4861772b2906f81a7d384552ad12  SOHEMBB12A6701E907           1   \n",
       "6    4e11f45d732f4861772b2906f81a7d384552ad12  SOHJOLH12A6310DFE5           1   \n",
       "7    4e11f45d732f4861772b2906f81a7d384552ad12  SOIZLKI12A6D4F7B61           1   \n",
       "8    4e11f45d732f4861772b2906f81a7d384552ad12  SOJGSIO12A8C141DBF           1   \n",
       "9    4e11f45d732f4861772b2906f81a7d384552ad12  SOKEYJQ12A6D4F6132           1   \n",
       "10   4e11f45d732f4861772b2906f81a7d384552ad12  SOKLRPJ12A8C13C3FE           1   \n",
       "11   4e11f45d732f4861772b2906f81a7d384552ad12  SOKNWRZ12A8C13BF62           2   \n",
       "12   4e11f45d732f4861772b2906f81a7d384552ad12  SOKXYUW12A8C140229           1   \n",
       "13   4e11f45d732f4861772b2906f81a7d384552ad12  SOLAUOW12A8C13A400           3   \n",
       "14   4e11f45d732f4861772b2906f81a7d384552ad12  SOLLDVS12AB0183835           6   \n",
       "15   4e11f45d732f4861772b2906f81a7d384552ad12  SOLOZRE12A8C133256           1   \n",
       "16   4e11f45d732f4861772b2906f81a7d384552ad12  SOLWRZI12A6D4FC4F0           1   \n",
       "17   4e11f45d732f4861772b2906f81a7d384552ad12  SOMDVSL12A6D4F7230           2   \n",
       "18   4e11f45d732f4861772b2906f81a7d384552ad12  SOMGIYR12AB0187973           1   \n",
       "19   4e11f45d732f4861772b2906f81a7d384552ad12  SOMNGMO12A6702187E           1   \n",
       "20   4e11f45d732f4861772b2906f81a7d384552ad12  SOMRYYN12A6310F0F3           1   \n",
       "21   4e11f45d732f4861772b2906f81a7d384552ad12  SONDCOR12A8C13BA16           1   \n",
       "22   4e11f45d732f4861772b2906f81a7d384552ad12  SONQBUB12A6D4F8ED0           3   \n",
       "23   4e11f45d732f4861772b2906f81a7d384552ad12  SONYKOW12AB01849C9           2   \n",
       "24   4e11f45d732f4861772b2906f81a7d384552ad12  SOOALOT12A8C13ABD9           5   \n",
       "25   4e11f45d732f4861772b2906f81a7d384552ad12  SOOKGRB12A8C13CD66           4   \n",
       "26   4e11f45d732f4861772b2906f81a7d384552ad12  SOOSJIV12AF729E09E           5   \n",
       "27   4e11f45d732f4861772b2906f81a7d384552ad12  SOOZFCC12A58A7D783           1   \n",
       "28   4e11f45d732f4861772b2906f81a7d384552ad12  SOPBXPQ12AB01887E2           2   \n",
       "29   4e11f45d732f4861772b2906f81a7d384552ad12  SOPCTBB12AF72A1B64           1   \n",
       "..                                        ...                 ...         ...   \n",
       "170  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOWOMMY127F8096DF9          18   \n",
       "171  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXGIWN12A6310E0D8           1   \n",
       "172  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXMGFH12A6701FF31           7   \n",
       "173  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXNYUA12AB017B49B           1   \n",
       "174  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXNZUH12AB018393F          15   \n",
       "175  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXPFLM12A8AE48C50          19   \n",
       "176  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXQYSC12A6310E908          26   \n",
       "177  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXWYZP12AF72A42A6          20   \n",
       "178  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXZOMB12AB017DA15           1   \n",
       "179  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOYCXUA12A8C133713           1   \n",
       "180  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOYEVUY12A8C145F58           1   \n",
       "181  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOZDACG12AB01853BB           6   \n",
       "182  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOZIBZP12A6701C434          11   \n",
       "183  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SODCNJX12A6D4F93CB          11   \n",
       "184  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SORALYQ12A8151BA99           9   \n",
       "185  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOUVTSM12AC468F6A7           2   \n",
       "186  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOVRMZU12AB017FE90           3   \n",
       "187  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOWPASM12A8C142B88           3   \n",
       "188  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOWSXLZ12AB017BD9A           1   \n",
       "189  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOYAIPB12A8C143D84          12   \n",
       "190  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOAXGDH12A8C13F8A1           4   \n",
       "191  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOHFNKO12AB017C772           2   \n",
       "192  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOHJOLH12A6310DFE5           2   \n",
       "193  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOILFUU12AB017C75F           3   \n",
       "194  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOIMQAK12A67ADE98C           1   \n",
       "195  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOODSPH12AB01819C3           4   \n",
       "196  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOOWVNN12A8C140775           2   \n",
       "197  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOPAYPV12AB017DB0C           2   \n",
       "198  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOPCQRT12A8C13B15D           1   \n",
       "199  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOPKPSQ12A58A7A5E4           1   \n",
       "\n",
       "    total_play_count  \n",
       "0                259  \n",
       "1                259  \n",
       "2                259  \n",
       "3                259  \n",
       "4                259  \n",
       "5                259  \n",
       "6                259  \n",
       "7                259  \n",
       "8                259  \n",
       "9                259  \n",
       "10               259  \n",
       "11               259  \n",
       "12               259  \n",
       "13               259  \n",
       "14               259  \n",
       "15               259  \n",
       "16               259  \n",
       "17               259  \n",
       "18               259  \n",
       "19               259  \n",
       "20               259  \n",
       "21               259  \n",
       "22               259  \n",
       "23               259  \n",
       "24               259  \n",
       "25               259  \n",
       "26               259  \n",
       "27               259  \n",
       "28               259  \n",
       "29               259  \n",
       "..               ...  \n",
       "170              423  \n",
       "171              423  \n",
       "172              423  \n",
       "173              423  \n",
       "174              423  \n",
       "175              423  \n",
       "176              423  \n",
       "177              423  \n",
       "178              423  \n",
       "179              423  \n",
       "180              423  \n",
       "181              423  \n",
       "182              423  \n",
       "183               41  \n",
       "184               41  \n",
       "185               41  \n",
       "186               41  \n",
       "187               41  \n",
       "188               41  \n",
       "189               41  \n",
       "190               61  \n",
       "191               61  \n",
       "192               61  \n",
       "193               61  \n",
       "194               61  \n",
       "195               61  \n",
       "196               61  \n",
       "197               61  \n",
       "198               61  \n",
       "199               61  \n",
       "\n",
       "[200 rows x 4 columns]"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "tripletDatasetSub.head(200)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:43.890602Z",
     "start_time": "2018-11-15T02:01:43.759595Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user</th>\n",
       "      <th>song</th>\n",
       "      <th>play_count</th>\n",
       "      <th>total_play_count</th>\n",
       "      <th>fractional_play_count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOCKSGZ12A58A7CA4B</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOCVTLJ12A6310F0FD</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SODLLYS12A8C13A96B</td>\n",
       "      <td>3</td>\n",
       "      <td>259</td>\n",
       "      <td>0.011583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOEGIYH12A6D4FC0E3</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOFRQTD12A81C233C0</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "      <td>0.00772201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOHEMBB12A6701E907</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOHJOLH12A6310DFE5</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOIZLKI12A6D4F7B61</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOJGSIO12A8C141DBF</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKEYJQ12A6D4F6132</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>10</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKLRPJ12A8C13C3FE</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>11</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKNWRZ12A8C13BF62</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "      <td>0.00772201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>12</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOKXYUW12A8C140229</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>13</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLAUOW12A8C13A400</td>\n",
       "      <td>3</td>\n",
       "      <td>259</td>\n",
       "      <td>0.011583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>14</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLLDVS12AB0183835</td>\n",
       "      <td>6</td>\n",
       "      <td>259</td>\n",
       "      <td>0.023166</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>15</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLOZRE12A8C133256</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>16</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOLWRZI12A6D4FC4F0</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMDVSL12A6D4F7230</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "      <td>0.00772201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>18</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMGIYR12AB0187973</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>19</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMNGMO12A6702187E</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>20</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOMRYYN12A6310F0F3</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>21</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONDCOR12A8C13BA16</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>22</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONQBUB12A6D4F8ED0</td>\n",
       "      <td>3</td>\n",
       "      <td>259</td>\n",
       "      <td>0.011583</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>23</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SONYKOW12AB01849C9</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "      <td>0.00772201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>24</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOALOT12A8C13ABD9</td>\n",
       "      <td>5</td>\n",
       "      <td>259</td>\n",
       "      <td>0.019305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>25</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOKGRB12A8C13CD66</td>\n",
       "      <td>4</td>\n",
       "      <td>259</td>\n",
       "      <td>0.015444</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>26</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOSJIV12AF729E09E</td>\n",
       "      <td>5</td>\n",
       "      <td>259</td>\n",
       "      <td>0.019305</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>27</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOOZFCC12A58A7D783</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>28</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOPBXPQ12AB01887E2</td>\n",
       "      <td>2</td>\n",
       "      <td>259</td>\n",
       "      <td>0.00772201</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>29</th>\n",
       "      <td>4e11f45d732f4861772b2906f81a7d384552ad12</td>\n",
       "      <td>SOPCTBB12AF72A1B64</td>\n",
       "      <td>1</td>\n",
       "      <td>259</td>\n",
       "      <td>0.003861</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>170</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOWOMMY127F8096DF9</td>\n",
       "      <td>18</td>\n",
       "      <td>423</td>\n",
       "      <td>0.0425532</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>171</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXGIWN12A6310E0D8</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "      <td>0.00236407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>172</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXMGFH12A6701FF31</td>\n",
       "      <td>7</td>\n",
       "      <td>423</td>\n",
       "      <td>0.0165485</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>173</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXNYUA12AB017B49B</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "      <td>0.00236407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>174</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXNZUH12AB018393F</td>\n",
       "      <td>15</td>\n",
       "      <td>423</td>\n",
       "      <td>0.035461</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>175</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXPFLM12A8AE48C50</td>\n",
       "      <td>19</td>\n",
       "      <td>423</td>\n",
       "      <td>0.0449173</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>176</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXQYSC12A6310E908</td>\n",
       "      <td>26</td>\n",
       "      <td>423</td>\n",
       "      <td>0.0614657</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>177</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXWYZP12AF72A42A6</td>\n",
       "      <td>20</td>\n",
       "      <td>423</td>\n",
       "      <td>0.0472813</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>178</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOXZOMB12AB017DA15</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "      <td>0.00236407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>179</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOYCXUA12A8C133713</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "      <td>0.00236407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>180</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOYEVUY12A8C145F58</td>\n",
       "      <td>1</td>\n",
       "      <td>423</td>\n",
       "      <td>0.00236407</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>181</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOZDACG12AB01853BB</td>\n",
       "      <td>6</td>\n",
       "      <td>423</td>\n",
       "      <td>0.0141844</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>182</th>\n",
       "      <td>371e9aff6b9f644e7598dbc4dd5640b1544b97f3</td>\n",
       "      <td>SOZIBZP12A6701C434</td>\n",
       "      <td>11</td>\n",
       "      <td>423</td>\n",
       "      <td>0.0260047</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>183</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SODCNJX12A6D4F93CB</td>\n",
       "      <td>11</td>\n",
       "      <td>41</td>\n",
       "      <td>0.268293</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>184</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SORALYQ12A8151BA99</td>\n",
       "      <td>9</td>\n",
       "      <td>41</td>\n",
       "      <td>0.219512</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>185</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOUVTSM12AC468F6A7</td>\n",
       "      <td>2</td>\n",
       "      <td>41</td>\n",
       "      <td>0.0487805</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>186</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOVRMZU12AB017FE90</td>\n",
       "      <td>3</td>\n",
       "      <td>41</td>\n",
       "      <td>0.0731707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>187</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOWPASM12A8C142B88</td>\n",
       "      <td>3</td>\n",
       "      <td>41</td>\n",
       "      <td>0.0731707</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>188</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOWSXLZ12AB017BD9A</td>\n",
       "      <td>1</td>\n",
       "      <td>41</td>\n",
       "      <td>0.0243902</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>189</th>\n",
       "      <td>c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d</td>\n",
       "      <td>SOYAIPB12A8C143D84</td>\n",
       "      <td>12</td>\n",
       "      <td>41</td>\n",
       "      <td>0.292683</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>190</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOAXGDH12A8C13F8A1</td>\n",
       "      <td>4</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0655738</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>191</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOHFNKO12AB017C772</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0327869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>192</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOHJOLH12A6310DFE5</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0327869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>193</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOILFUU12AB017C75F</td>\n",
       "      <td>3</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0491803</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>194</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOIMQAK12A67ADE98C</td>\n",
       "      <td>1</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0163934</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>195</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOODSPH12AB01819C3</td>\n",
       "      <td>4</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0655738</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>196</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOOWVNN12A8C140775</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0327869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>197</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOPAYPV12AB017DB0C</td>\n",
       "      <td>2</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0327869</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>198</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOPCQRT12A8C13B15D</td>\n",
       "      <td>1</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0163934</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>199</th>\n",
       "      <td>13ce57b3a25ef63fa614335fd838e8024c42ec17</td>\n",
       "      <td>SOPKPSQ12A58A7A5E4</td>\n",
       "      <td>1</td>\n",
       "      <td>61</td>\n",
       "      <td>0.0163934</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>200 rows × 5 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "                                         user                song  play_count  \\\n",
       "0    4e11f45d732f4861772b2906f81a7d384552ad12  SOCKSGZ12A58A7CA4B           1   \n",
       "1    4e11f45d732f4861772b2906f81a7d384552ad12  SOCVTLJ12A6310F0FD           1   \n",
       "2    4e11f45d732f4861772b2906f81a7d384552ad12  SODLLYS12A8C13A96B           3   \n",
       "3    4e11f45d732f4861772b2906f81a7d384552ad12  SOEGIYH12A6D4FC0E3           1   \n",
       "4    4e11f45d732f4861772b2906f81a7d384552ad12  SOFRQTD12A81C233C0           2   \n",
       "5    4e11f45d732f4861772b2906f81a7d384552ad12  SOHEMBB12A6701E907           1   \n",
       "6    4e11f45d732f4861772b2906f81a7d384552ad12  SOHJOLH12A6310DFE5           1   \n",
       "7    4e11f45d732f4861772b2906f81a7d384552ad12  SOIZLKI12A6D4F7B61           1   \n",
       "8    4e11f45d732f4861772b2906f81a7d384552ad12  SOJGSIO12A8C141DBF           1   \n",
       "9    4e11f45d732f4861772b2906f81a7d384552ad12  SOKEYJQ12A6D4F6132           1   \n",
       "10   4e11f45d732f4861772b2906f81a7d384552ad12  SOKLRPJ12A8C13C3FE           1   \n",
       "11   4e11f45d732f4861772b2906f81a7d384552ad12  SOKNWRZ12A8C13BF62           2   \n",
       "12   4e11f45d732f4861772b2906f81a7d384552ad12  SOKXYUW12A8C140229           1   \n",
       "13   4e11f45d732f4861772b2906f81a7d384552ad12  SOLAUOW12A8C13A400           3   \n",
       "14   4e11f45d732f4861772b2906f81a7d384552ad12  SOLLDVS12AB0183835           6   \n",
       "15   4e11f45d732f4861772b2906f81a7d384552ad12  SOLOZRE12A8C133256           1   \n",
       "16   4e11f45d732f4861772b2906f81a7d384552ad12  SOLWRZI12A6D4FC4F0           1   \n",
       "17   4e11f45d732f4861772b2906f81a7d384552ad12  SOMDVSL12A6D4F7230           2   \n",
       "18   4e11f45d732f4861772b2906f81a7d384552ad12  SOMGIYR12AB0187973           1   \n",
       "19   4e11f45d732f4861772b2906f81a7d384552ad12  SOMNGMO12A6702187E           1   \n",
       "20   4e11f45d732f4861772b2906f81a7d384552ad12  SOMRYYN12A6310F0F3           1   \n",
       "21   4e11f45d732f4861772b2906f81a7d384552ad12  SONDCOR12A8C13BA16           1   \n",
       "22   4e11f45d732f4861772b2906f81a7d384552ad12  SONQBUB12A6D4F8ED0           3   \n",
       "23   4e11f45d732f4861772b2906f81a7d384552ad12  SONYKOW12AB01849C9           2   \n",
       "24   4e11f45d732f4861772b2906f81a7d384552ad12  SOOALOT12A8C13ABD9           5   \n",
       "25   4e11f45d732f4861772b2906f81a7d384552ad12  SOOKGRB12A8C13CD66           4   \n",
       "26   4e11f45d732f4861772b2906f81a7d384552ad12  SOOSJIV12AF729E09E           5   \n",
       "27   4e11f45d732f4861772b2906f81a7d384552ad12  SOOZFCC12A58A7D783           1   \n",
       "28   4e11f45d732f4861772b2906f81a7d384552ad12  SOPBXPQ12AB01887E2           2   \n",
       "29   4e11f45d732f4861772b2906f81a7d384552ad12  SOPCTBB12AF72A1B64           1   \n",
       "..                                        ...                 ...         ...   \n",
       "170  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOWOMMY127F8096DF9          18   \n",
       "171  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXGIWN12A6310E0D8           1   \n",
       "172  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXMGFH12A6701FF31           7   \n",
       "173  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXNYUA12AB017B49B           1   \n",
       "174  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXNZUH12AB018393F          15   \n",
       "175  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXPFLM12A8AE48C50          19   \n",
       "176  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXQYSC12A6310E908          26   \n",
       "177  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXWYZP12AF72A42A6          20   \n",
       "178  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOXZOMB12AB017DA15           1   \n",
       "179  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOYCXUA12A8C133713           1   \n",
       "180  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOYEVUY12A8C145F58           1   \n",
       "181  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOZDACG12AB01853BB           6   \n",
       "182  371e9aff6b9f644e7598dbc4dd5640b1544b97f3  SOZIBZP12A6701C434          11   \n",
       "183  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SODCNJX12A6D4F93CB          11   \n",
       "184  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SORALYQ12A8151BA99           9   \n",
       "185  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOUVTSM12AC468F6A7           2   \n",
       "186  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOVRMZU12AB017FE90           3   \n",
       "187  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOWPASM12A8C142B88           3   \n",
       "188  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOWSXLZ12AB017BD9A           1   \n",
       "189  c0ff0f1c93f67c1fb372b36b1b08bb4c76bead7d  SOYAIPB12A8C143D84          12   \n",
       "190  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOAXGDH12A8C13F8A1           4   \n",
       "191  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOHFNKO12AB017C772           2   \n",
       "192  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOHJOLH12A6310DFE5           2   \n",
       "193  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOILFUU12AB017C75F           3   \n",
       "194  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOIMQAK12A67ADE98C           1   \n",
       "195  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOODSPH12AB01819C3           4   \n",
       "196  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOOWVNN12A8C140775           2   \n",
       "197  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOPAYPV12AB017DB0C           2   \n",
       "198  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOPCQRT12A8C13B15D           1   \n",
       "199  13ce57b3a25ef63fa614335fd838e8024c42ec17  SOPKPSQ12A58A7A5E4           1   \n",
       "\n",
       "    total_play_count fractional_play_count  \n",
       "0                259              0.003861  \n",
       "1                259              0.003861  \n",
       "2                259              0.011583  \n",
       "3                259              0.003861  \n",
       "4                259            0.00772201  \n",
       "5                259              0.003861  \n",
       "6                259              0.003861  \n",
       "7                259              0.003861  \n",
       "8                259              0.003861  \n",
       "9                259              0.003861  \n",
       "10               259              0.003861  \n",
       "11               259            0.00772201  \n",
       "12               259              0.003861  \n",
       "13               259              0.011583  \n",
       "14               259              0.023166  \n",
       "15               259              0.003861  \n",
       "16               259              0.003861  \n",
       "17               259            0.00772201  \n",
       "18               259              0.003861  \n",
       "19               259              0.003861  \n",
       "20               259              0.003861  \n",
       "21               259              0.003861  \n",
       "22               259              0.011583  \n",
       "23               259            0.00772201  \n",
       "24               259              0.019305  \n",
       "25               259              0.015444  \n",
       "26               259              0.019305  \n",
       "27               259              0.003861  \n",
       "28               259            0.00772201  \n",
       "29               259              0.003861  \n",
       "..               ...                   ...  \n",
       "170              423             0.0425532  \n",
       "171              423            0.00236407  \n",
       "172              423             0.0165485  \n",
       "173              423            0.00236407  \n",
       "174              423              0.035461  \n",
       "175              423             0.0449173  \n",
       "176              423             0.0614657  \n",
       "177              423             0.0472813  \n",
       "178              423            0.00236407  \n",
       "179              423            0.00236407  \n",
       "180              423            0.00236407  \n",
       "181              423             0.0141844  \n",
       "182              423             0.0260047  \n",
       "183               41              0.268293  \n",
       "184               41              0.219512  \n",
       "185               41             0.0487805  \n",
       "186               41             0.0731707  \n",
       "187               41             0.0731707  \n",
       "188               41             0.0243902  \n",
       "189               41              0.292683  \n",
       "190               61             0.0655738  \n",
       "191               61             0.0327869  \n",
       "192               61             0.0327869  \n",
       "193               61             0.0491803  \n",
       "194               61             0.0163934  \n",
       "195               61             0.0655738  \n",
       "196               61             0.0327869  \n",
       "197               61             0.0327869  \n",
       "198               61             0.0163934  \n",
       "199               61             0.0163934  \n",
       "\n",
       "[200 rows x 5 columns]"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#每个用户每首歌曲的播放比例\n",
    "tripletDatasetSub[\"fractional_play_count\"] = tripletDatasetSub[\"play_count\"]/tripletDatasetSub[\"total_play_count\"]\n",
    "tripletDatasetSub.head(200)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分割训练及测试集数据"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:45.044668Z",
     "start_time": "2018-11-15T02:01:43.897603Z"
    }
   },
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\starwin\\Anaconda3\\lib\\site-packages\\sklearn\\model_selection\\_split.py:2026: FutureWarning: From version 0.21, test_size will always complement train_size unless both are specified.\n",
      "  FutureWarning)\n"
     ]
    }
   ],
   "source": [
    "from sklearn.model_selection import train_test_split\n",
    "\n",
    "df_triplet_train, df_triplet_test = train_test_split(tripletDatasetSub, train_size = 0.6, random_state = 7)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:45.096671Z",
     "start_time": "2018-11-15T02:01:45.050669Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style>\n",
       "    .dataframe thead tr:only-child th {\n",
       "        text-align: right;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: left;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>user</th>\n",
       "      <th>song</th>\n",
       "      <th>play_count</th>\n",
       "      <th>total_play_count</th>\n",
       "      <th>fractional_play_count</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>32013</th>\n",
       "      <td>c2dbf6f4c32dc36af4d6fadb16cd8b79c64a6aa8</td>\n",
       "      <td>SONYKOW12AB01849C9</td>\n",
       "      <td>1</td>\n",
       "      <td>824</td>\n",
       "      <td>0.00121359</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>36895</th>\n",
       "      <td>6c6289326f70321f2b3e072daa44819efc55639a</td>\n",
       "      <td>SOTEGWG12AB01897AC</td>\n",
       "      <td>4</td>\n",
       "      <td>698</td>\n",
       "      <td>0.00573066</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9387</th>\n",
       "      <td>324de4a258619466993c3bd75f340bc19e82bc62</td>\n",
       "      <td>SORAHAG12AB0182BD0</td>\n",
       "      <td>5</td>\n",
       "      <td>139</td>\n",
       "      <td>0.0359712</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>17230</th>\n",
       "      <td>6e0a8e9103ad7d68e63d350fbff3386c75613ab2</td>\n",
       "      <td>SOOKGRB12A8C13CD66</td>\n",
       "      <td>1</td>\n",
       "      <td>686</td>\n",
       "      <td>0.00145773</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6064</th>\n",
       "      <td>7ffc14a55b6256c9fa73fc5c5761d210deb7f738</td>\n",
       "      <td>SOUCMUI12AB018C0C6</td>\n",
       "      <td>4</td>\n",
       "      <td>1259</td>\n",
       "      <td>0.00317712</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                           user                song  \\\n",
       "32013  c2dbf6f4c32dc36af4d6fadb16cd8b79c64a6aa8  SONYKOW12AB01849C9   \n",
       "36895  6c6289326f70321f2b3e072daa44819efc55639a  SOTEGWG12AB01897AC   \n",
       "9387   324de4a258619466993c3bd75f340bc19e82bc62  SORAHAG12AB0182BD0   \n",
       "17230  6e0a8e9103ad7d68e63d350fbff3386c75613ab2  SOOKGRB12A8C13CD66   \n",
       "6064   7ffc14a55b6256c9fa73fc5c5761d210deb7f738  SOUCMUI12AB018C0C6   \n",
       "\n",
       "       play_count total_play_count fractional_play_count  \n",
       "32013           1              824            0.00121359  \n",
       "36895           4              698            0.00573066  \n",
       "9387            5              139             0.0359712  \n",
       "17230           1              686            0.00145773  \n",
       "6064            4             1259            0.00317712  "
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_triplet_train.head()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:01:45.159675Z",
     "start_time": "2018-11-15T02:01:45.110672Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'SONYKOW12AB01849C9'"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_triplet_train.iloc[0][\"song\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 计算训练数据集的倒排表"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:17.852545Z",
     "start_time": "2018-11-15T02:01:45.168676Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#提出用户与歌曲的列表\n",
    "users = list(df_triplet_train[\"user\"].unique())\n",
    "items = list(df_triplet_train[\"song\"].unique())\n",
    "n_users = len(users)\n",
    "n_items = len(items)\n",
    "\n",
    "#创建集合存放倒排表\n",
    "user_items = defaultdict(set)\n",
    "item_users = defaultdict(set)\n",
    "\n",
    "#建立用户-歌曲的稀疏矩阵\n",
    "user_item_socres = ss.dok_matrix((n_users, n_items))\n",
    "\n",
    "#由于dok_matrix的行列索引需要整型int，而用户及物品目前的编码不是整型，所以需要整理一下，重新编码\n",
    "users_index = dict()\n",
    "items_index = dict()\n",
    "for i, u in enumerate(users):\n",
    "    users_index[u] = i\n",
    "    \n",
    "for i, u in enumerate(items):\n",
    "    items_index[u] = i\n",
    "\n",
    "n_records = df_triplet_train.shape[0]#训练数据集的行数\n",
    "\n",
    "for i in range(n_records):\n",
    "    user_index_i = users_index[df_triplet_train.iloc[i][\"user\"]]\n",
    "    item_index_i = items_index[df_triplet_train.iloc[i][\"song\"]]\n",
    "    \n",
    "    user_items[user_index_i].add(item_index_i)\n",
    "    user_items[item_index_i].add(user_index_i)\n",
    "    \n",
    "    score = df_triplet_train.iloc[i][\"fractional_play_count\"]\n",
    "    user_item_socres[user_index_i, item_index_i] = score\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 计算每个用户的平均分"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:19.637647Z",
     "start_time": "2018-11-15T02:02:17.857545Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "users_mu = np.zeros(n_users)\n",
    "for u in range(n_users):\n",
    "    n_user_items = 0\n",
    "    r_acc = 0.0\n",
    "    \n",
    "    for i in user_items[u]:\n",
    "        r_acc = r_acc + user_item_socres[u, i]\n",
    "        n_user_items = n_user_items + 1\n",
    "    \n",
    "    users_mu[u] = r_acc/n_user_items\n",
    "\n",
    "#计算用户平均分\n",
    "mu = df_triplet_train[\"fractional_play_count\"].mean()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 用户与物品的相似度计算公式是类似的，所以直接定义一个函数来分别调用计算用户与物品的相似度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:19.735653Z",
     "start_time": "2018-11-15T02:02:19.641647Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#老师讲解的方法一：\n",
    "def Cal_Similarity(userID_or_itemID_1, userID_or_itemID_2):\n",
    "    si = {}\n",
    "    for item in user_items[userID_or_itemID_1]:#用户1所打过分的item\n",
    "        if item in user_items[userID_or_itemID_2]:#用户2也打过分的item\n",
    "            si[item] = 1\n",
    "    n =len(si)\n",
    "    if (n ==0):\n",
    "        similarity = 0\n",
    "        return similarity\n",
    "    \n",
    "    #用户1、2减去平均分\n",
    "    userScore1 = np.array([user_item_socres[userID_or_itemID_1,item] - users_mu[userID_or_itemID_1] for item in si])    \n",
    "    userScore2 = np.array([user_item_socres[userID_or_itemID_2,item] - users_mu[userID_or_itemID_2] for item in si])\n",
    "    \n",
    "    #1减去余弦夹角等于相似度\n",
    "    similarity =1 - ssd.cosine(userScore1, userScore2)\n",
    "    \n",
    "    if np.isnan(similarity):#为了避免分母为0的情况所以增加这个if判断。\n",
    "        similarity = 0\n",
    "    return similarity"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 计算两个用户的相似度"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:19.841659Z",
     "start_time": "2018-11-15T02:02:19.753654Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#老师讲解的方法二：\n",
    "def Cal_Similarity_For_userItem(userID_or_itemID_1, userID_or_itemID_2):\n",
    "    s1 = user_items[userID_or_itemID_1]\n",
    "    s2 = user_items[userID_or_itemID_2]\n",
    "    \n",
    "    intersection = s1.intersection(s2)#计算交集\n",
    "    \n",
    "    #用交集除以并集\n",
    "    if len(intersection) != 0:\n",
    "        union = s1.union(s2)\n",
    "        similarity = float(len(intersection))/float(len(union))\n",
    "    else:\n",
    "        similarity = 0"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 调用上面的函数来计算用户之间的相似性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:30.175250Z",
     "start_time": "2018-11-15T02:02:19.866660Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "userSimilarity_matrix = np.matrix(np.zeros(shape = (n_users, n_users)), float)\n",
    "\n",
    "for userID_i in range(n_users):\n",
    "    userSimilarity_matrix[userID_i,userID_i] = 1.0\n",
    "    \n",
    "    for userID_j in range(userID_i+1 , n_users):\n",
    "        userSimilarity_matrix[userID_j, userID_i] = Cal_Similarity_For_userItem(userID_i, userID_j)\n",
    "        userSimilarity_matrix[userID_i, userID_j] = Cal_Similarity_For_userItem(userID_j, userID_i)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 同样调用上面定义的函数来计算用户之间的相似性"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:40.755855Z",
     "start_time": "2018-11-15T02:02:30.188251Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "itemSimilarity_matrix = np.matrix(np.zeros(shape = (n_items, n_items)), float)\n",
    "\n",
    "for itemID_i in range(n_items):\n",
    "    itemSimilarity_matrix[itemID_i,itemID_i] = 1.0\n",
    "    \n",
    "    for itemID_j in range(itemID_i+1 , n_items):\n",
    "        itemSimilarity_matrix[userID_j, userID_i] = Cal_Similarity_For_userItem(itemID_i, itemID_j)\n",
    "        itemSimilarity_matrix[userID_i, userID_j] = Cal_Similarity_For_userItem(itemID_j, itemID_i)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:40.776856Z",
     "start_time": "2018-11-15T02:02:40.761855Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'SONYKOW12AB01849C9'"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df_triplet_train.iloc[0][\"song\"]"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## SVD模型过滤前的训练"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:40.990868Z",
     "start_time": "2018-11-15T02:02:40.790857Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#模型初始化\n",
    "from numpy.random import random\n",
    "K = 40 #隐含变量的维数\n",
    "\n",
    "#item和用户的偏置项\n",
    "bi = np.zeros((n_items,1))\n",
    "bu = np.zeros((n_users,1))\n",
    "\n",
    "#隐含向量\n",
    "qi = np.zeros((n_items, K))\n",
    "pu = np.zeros((n_users, K))\n",
    "\n",
    "for userID in range(n_users):\n",
    "    pu[userID] = np.reshape(random((K,1))/10*(np.sqrt(K)),K)\n",
    "    \n",
    "for itemID in range(n_items):\n",
    "    qi[itemID] = np.reshape(random((K,1))/10*(np.sqrt(K)),K)\n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 定义一个预测用户对歌曲的打分的函数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:02:41.034871Z",
     "start_time": "2018-11-15T02:02:40.999869Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def socrePredict_SVD(userID, itemID):\n",
    "    score = mu + bi[itemID] + bu[userID] + np.sum(qi[itemID]*pu[userID])\n",
    "    \n",
    "    return score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 训练模型"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:05:49.064626Z",
     "start_time": "2018-11-15T02:02:41.042871Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "每一个Step的RMSE是： [0.00025566]\n",
      "每一个Step的RMSE是： [0.00022292]\n",
      "每一个Step的RMSE是： [4.44451827e-05]\n",
      "每一个Step的RMSE是： [0.00010617]\n",
      "每一个Step的RMSE是： [6.07474972e-05]\n"
     ]
    }
   ],
   "source": [
    "Par_steps = 5 #迭代次数\n",
    "Par_gamma = 0.1  #学习率\n",
    "Par_lambda = 0.15 #正则参数\n",
    "\n",
    "for step in range(Par_steps):\n",
    "    rmse_sum = 0.0\n",
    "    \n",
    "    #将样本打散顺序\n",
    "    kk = np.random.permutation(n_records)\n",
    "    for j in range(n_records):\n",
    "        line = kk[j]\n",
    "        \n",
    "        userID = users_index[df_triplet_train.iloc[line][\"user\"]]\n",
    "        itemID = items_index[df_triplet_train.iloc[line][\"song\"]]\n",
    "        rating = df_triplet_train.iloc[line][\"fractional_play_count\"]\n",
    "        \n",
    "        #预测残差\n",
    "        error = rating - socrePredict_SVD(userID, itemID)\n",
    "        rmse_sum = error**2\n",
    "        \n",
    "        #使用随机梯度下降\n",
    "        bu[userID] += Par_gamma * (error - Par_lambda * bu[userID])\n",
    "        bi[itemID] += Par_gamma * (error - Par_lambda * bi[itemID])\n",
    "        \n",
    "        temp = qi[itemID]\n",
    "        qi[itemID] += Par_gamma * (error * pu[userID] - Par_lambda * qi[itemID])\n",
    "        pu[userID] += Par_gamma * (error * temp - Par_lambda * pu[userID])\n",
    "    Par_gamma= Par_gamma * 0.93\n",
    "    print (\"每一个Step的RMSE是：\", np.sqrt(rmse_sum/n_records))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 保存模型的参数"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:05:49.108628Z",
     "start_time": "2018-11-15T02:05:49.070626Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def saveJsonFile(filepath):\n",
    "    dict_Par = {}\n",
    "    dict_Par[\"mu\"] = mu\n",
    "    dict_Par[\"K\"] = K\n",
    "    \n",
    "    dict_Par[\"bi\"] = bi.tolist()\n",
    "    dict_Par[\"bu\"] = bu.tolist()\n",
    "    dict_Par[\"qi\"] = qi.tolist()\n",
    "    dict_Par[\"pu\"] = pu.tolist()\n",
    "    \n",
    "    json_txt = json.dumps(dict_Par)\n",
    "    with open(filepath, 'w') as file:\n",
    "        file.write(json_txt)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基于用户的协同过滤"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 25,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:05:49.165631Z",
     "start_time": "2018-11-15T02:05:49.115629Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def userCF_predict(userID,itemID, similarity_matrix):\n",
    "    sim_accumulate = 0.0\n",
    "    rat_acc = 0.0\n",
    "    for user_id in item_users[itemID]:\n",
    "        sim = similarity_matrix[user_id,userID]\n",
    "        \n",
    "        if sim != 0:\n",
    "            rat_acc += sim * (user_item_socres[user_id, itemID] - users_mu[user_id])#调用上面打分矩阵来计算\n",
    "            sim_accumulate += np.abs(sim)\n",
    "            \n",
    "    if sim_accumulate !=0:\n",
    "        score = users_mu[userID] + rat_acc/sim_accumulate\n",
    "    else:\n",
    "        score = users_mu[userID]\n",
    "    \n",
    "    return score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基于物品的协同过滤"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:05:49.497650Z",
     "start_time": "2018-11-15T02:05:49.172632Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def itemCF_predict(userID, itemID, similarity_matrix, n_Knns):\n",
    "    sim_accumulate = 0.0\n",
    "    rat_acc = 0.0\n",
    "    n_nn_items = 0\n",
    "    \n",
    "    #相似度排序\n",
    "    cur_items_similarity = np.array(similarity_matrix[itemID,:])\n",
    "    cur_items_similarity = cur_items_similarity.flatten()\n",
    "    sort_index = sorted(((e,i) for i,e in enumerate(list(cur_items_similarity))), reverse = True)\n",
    "    \n",
    "    for i in range(0, len(sort_index)):\n",
    "        cur_item_index = sort_index[i][1]\n",
    "        \n",
    "        if n_nn_items >= n_Knns:\n",
    "            break\n",
    "        \n",
    "        if cur_item_index in user_items[userID]:\n",
    "            sim = similarity_matrix[itemID, cur_item_index]\n",
    "            \n",
    "            if sim != 0:\n",
    "                rat_acc += sim * (user_item_socres[userID, cur_item_index])\n",
    "                sim_accumulate += np.abs(sim)\n",
    "            n_nn_items += 1\n",
    "            \n",
    "    if sim_accumulate != 0:\n",
    "        score = rat_acc/sim_accumulate\n",
    "    else:\n",
    "        score = users_mu[userID]\n",
    "    \n",
    "    if score < 0:\n",
    "        score = 0.0\n",
    "    \n",
    "    return score\n",
    "            \n",
    "    "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 基于SVD模型的协同过滤"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 27,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:05:49.521652Z",
     "start_time": "2018-11-15T02:05:49.504651Z"
    },
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def SVD_CF_predict(userID, itemID):\n",
    "    score = mu + bi[itemID] + bu[userID] + np.sum(qi[itemID]*pu[userID])\n",
    "    return score"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 定义对各模型预测用户的打分方法，便于后续循环调用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T05:44:36.991500Z",
     "start_time": "2018-11-15T05:44:36.609478Z"
    }
   },
   "outputs": [],
   "source": [
    "n_Knns = 10\n",
    "\n",
    "def recommendItem(user,CF_Method):#CF_Method用来代表是使用哪种过滤方法\n",
    "    cur_user_id = users_index[user]\n",
    "    #训练集中用户打过分的item\n",
    "    cur_user_items = user_items[cur_user_id]\n",
    "    \n",
    "    #用户对所有item的打分,分别定义了三个协同过滤变量来存放\n",
    "    if (CF_Method == \"userCF\"):\n",
    "        user_items_socres_using_userCF = np.zeros(n_items)\n",
    "    elif (CF_Method == \"itemCF\"):\n",
    "        user_items_socres_using_itemCF = np.zeros(n_items)\n",
    "    elif (CF_Method == \"SVDCF\"):\n",
    "        user_items_socres_using_SVDCF = np.zeros(n_items)\n",
    "        \n",
    "    #预测打分\n",
    "    for i in range(n_items):\n",
    "        if i not in cur_user_items:#训练集中没有打过分的item\n",
    "            #基于用户的协同过滤\n",
    "            if (CF_Method == \"userCF\"):\n",
    "                user_items_socres_using_userCF[i] = userCF_predict(cur_user_id, i, userSimilarity_matrix)\n",
    "            #基于物品的协同过滤\n",
    "            elif (CF_Method == \"itemCF\"):\n",
    "                user_items_socres_using_itemCF[i] = itemCF_predict(cur_user_id, i, itemSimilarity_matrix,n_Knns)\n",
    "            #基于模型的协同过滤\n",
    "            elif (CF_Method == \"SVDCF\"):\n",
    "                user_items_socres_using_SVDCF[i] = SVD_CF_predict(cur_user_id, i)\n",
    "     \n",
    "    ##基于用户的协同过滤的推荐\n",
    "    if (CF_Method == \"userCF\"):\n",
    "        sort_index = sorted(((e,i) for i, e in enumerate(list(user_items_socres_using_userCF))),reverse=True)\n",
    "     #基于物品的协同过滤的推荐\n",
    "    elif (CF_Method == \"itemCF\"):\n",
    "        sort_index = sorted(((e,i) for i, e in enumerate(list(user_items_socres_using_itemCF))),reverse=True)\n",
    "    #基于模型的协同过滤的推荐\n",
    "    elif (CF_Method == \"SVDCF\"):\n",
    "        sort_index = sorted(((e,i) for i, e in enumerate(list(user_items_socres_using_SVDCF))),reverse=True)\n",
    "    \n",
    "    \n",
    "    columns = {\"item_id\", \"score\"}\n",
    "    df = pd.DataFrame(columns = columns)\n",
    "\n",
    "    for i in range(0, len(sort_index)):\n",
    "        cur_item_index = sort_index[i][1]\n",
    "        cur_item = list(items_index.keys())[list(items_index.values()).index(cur_item_index)]\n",
    "        \n",
    "        if ~np.isnan(sort_index[i][0]) and cur_item_index not in cur_user_items:\n",
    "            df.loc[len(df)]=[sort_index[i][0],cur_item]\n",
    "            \n",
    "    return df\n",
    "            "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 定义计算评价指标方法，便于三种过滤方法调用"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 65,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T05:56:47.789299Z",
     "start_time": "2018-11-15T05:56:47.382276Z"
    },
    "scrolled": true
   },
   "outputs": [],
   "source": [
    "def Cal_Metric(CF_Method):#CF_Method用来代表是使用哪种过滤方法\n",
    "    unique_users_test = df_triplet_test[\"user\"].unique()\n",
    "\n",
    "    #为每个用户推荐的item数目\n",
    "    N_recommendItems = 20\n",
    "\n",
    "    n_hits = 0\n",
    "    n_total_rec_items = 0\n",
    "    n_test_items = 0\n",
    "\n",
    "    all_recover_items = set() #计算推荐商品的集合，计算覆盖度\n",
    "\n",
    "    #中间变量用于计算RMSE\n",
    "    rss_test = 0.0\n",
    "\n",
    "    for user in unique_users_test:\n",
    "        if user not in users_index:\n",
    "            print(user)\n",
    "            continue\n",
    "    \n",
    "        df_user_records_test = df_triplet_test[df_triplet_test.user == user]\n",
    "        df_rec_items = recommendItem(user,CF_Method)\n",
    "    \n",
    "    \n",
    "        for i in range(N_recommendItems):        \n",
    "            item = df_rec_items.iloc[i][\"item_id\"]\n",
    "       \n",
    "            if item in df_user_records_test[\"song\"].values:\n",
    "                n_hits +=1\n",
    "                all_recover_items.add(item)\n",
    "            \n",
    "        #对测试集中的每条记录计算RMSE\n",
    "        for i in range(df_user_records_test.shape[0]):\n",
    "            item = df_user_records_test.iloc[i][\"song\"]\n",
    "            score = df_user_records_test.iloc[i][\"fractional_play_count\"]\n",
    "            df1 = df_rec_items[df_rec_items.item_id == item]\n",
    "            if (df1.shape[0] == 0):\n",
    "                continue\n",
    "            #print(df_rec_items.item_id)\n",
    "            #print(\"--------\")\n",
    "            #print(item)       \n",
    "            #print(df1)\n",
    "            pred_socre = df1[\"score\"].values[0]\n",
    "        \n",
    "            rss_test += (pred_socre - score)**2   #残差平方和\n",
    "        \n",
    "            #推荐的Item总数\n",
    "            n_total_rec_items += N_recommendItems\n",
    "        \n",
    "            #真实的Item总数\n",
    "            n_test_items += df_user_records_test.shape[0]\n",
    "            \n",
    "    # 准确率\n",
    "    precision = n_hits / (1.0*n_total_rec_items)\n",
    "    print(\"准确率为：\",precision)\n",
    "    #召回率\n",
    "    recall = n_hits / (1.0*n_test_items)\n",
    "    print(\"召回率为：\",recall)\n",
    "    #覆盖率\n",
    "    coverage = len(all_recover_items) / (1.0*n_items)\n",
    "    print(\"覆盖率为：\",coverage)\n",
    "    #均方误差\n",
    "    rmse = np.sqrt(rss_test / df_triplet_test.shape[0])\n",
    "    print(\"均方误差为：\",rmse)       "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 分别对三个过滤方法调用上面评价指标计算方法"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T02:05:55.070969Z",
     "start_time": "2018-11-15T02:00:05.310Z"
    }
   },
   "source": [
    "### 基于用户过滤的推荐评价"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 66,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T06:56:17.514476Z",
     "start_time": "2018-11-15T05:57:39.032230Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7c9b8125c230d20b19317aa06a4b3f8415057f88\n",
      "de27b74444dae039f76e421362c6a914da9f8b41\n",
      "467e0e46181933c7e1a936e513ca55fbab4edaed\n",
      "52a6c7b6221f57c89dacbbd06854ca0dc415e9e6\n",
      "11cfd7a90f8f80eea6520ecd1f6ab853fb837292\n",
      "62420be0fd0df5ab0eb4cba35a4bc7cb3e3b506a\n",
      "7875303e731b91b046ec6fbcd640e0b7d8499753\n",
      "c337bc0346e01c8b0105691b8f970b9a6960a572\n",
      "e504626e4d38404e3928bda4b0f266cbd38c42d8\n",
      "准确率为： 0.0007197798320513725\n",
      "召回率为： 0.0003790694217333135\n",
      "覆盖率为： 0.02875\n",
      "均方误差为： 0.051521991780432264\n"
     ]
    }
   ],
   "source": [
    "Cal_Metric(\"userCF\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 基于物品过滤的推荐评价"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 67,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T08:06:32.385553Z",
     "start_time": "2018-11-15T06:56:28.370097Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7c9b8125c230d20b19317aa06a4b3f8415057f88\n",
      "de27b74444dae039f76e421362c6a914da9f8b41\n",
      "467e0e46181933c7e1a936e513ca55fbab4edaed\n",
      "52a6c7b6221f57c89dacbbd06854ca0dc415e9e6\n",
      "11cfd7a90f8f80eea6520ecd1f6ab853fb837292\n",
      "62420be0fd0df5ab0eb4cba35a4bc7cb3e3b506a\n",
      "7875303e731b91b046ec6fbcd640e0b7d8499753\n",
      "c337bc0346e01c8b0105691b8f970b9a6960a572\n",
      "e504626e4d38404e3928bda4b0f266cbd38c42d8\n",
      "准确率为： 0.0007197798320513725\n",
      "召回率为： 0.0003790694217333135\n",
      "覆盖率为： 0.02875\n",
      "均方误差为： 0.051521991780432264\n"
     ]
    }
   ],
   "source": [
    "Cal_Metric(\"itemCF\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 基于模型过滤的推荐评价"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 68,
   "metadata": {
    "ExecuteTime": {
     "end_time": "2018-11-15T09:04:02.373881Z",
     "start_time": "2018-11-15T08:06:32.392553Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "7c9b8125c230d20b19317aa06a4b3f8415057f88\n",
      "de27b74444dae039f76e421362c6a914da9f8b41\n",
      "467e0e46181933c7e1a936e513ca55fbab4edaed\n",
      "52a6c7b6221f57c89dacbbd06854ca0dc415e9e6\n",
      "11cfd7a90f8f80eea6520ecd1f6ab853fb837292\n",
      "62420be0fd0df5ab0eb4cba35a4bc7cb3e3b506a\n",
      "7875303e731b91b046ec6fbcd640e0b7d8499753\n",
      "c337bc0346e01c8b0105691b8f970b9a6960a572\n",
      "e504626e4d38404e3928bda4b0f266cbd38c42d8\n",
      "准确率为： 0.002907345988285936\n",
      "召回率为： 0.0015311431544522075\n",
      "覆盖率为： 0.125\n",
      "均方误差为： 0.06907950174529835\n"
     ]
    }
   ],
   "source": [
    "Cal_Metric(\"SVDCF\")"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "从上面的推荐评价计算结果看来，确实是基于模型的过滤推荐算法性能最好，准确率、召回率、覆盖率相对比较高。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.3"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": true
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
